Skip to content

Commit bf002c8

Browse files
committed
add reload graph
1 parent fa144e1 commit bf002c8

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

packages/client/providers/src/lib/PubSubProvider.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ export const events: PubSubEvents = {
6161
$MULTI_SELECT_COPY: tabId => `multiSelectCopy:${tabId}`,
6262
$MULTI_SELECT_PASTE: tabId => `multiSelectPaste:${tabId}`,
6363
$REFRESH_EVENT_TABLE: tabId => `refreshEventTable:${tabId}`,
64+
$RELOAD_GRAPH: tabId => `reloadGraph:${tabId}`,
6465
}
6566

6667
// Create the PubSubProvider component
@@ -76,6 +77,7 @@ export const PubSubProvider = ({ children }) => {
7677

7778
// Publish function
7879
const publish = (event: string, data?: PubSubData) => {
80+
console.log('DATA', data)
7981
return PubSub.publish(event, data)
8082
}
8183

@@ -111,15 +113,17 @@ export const PubSubProvider = ({ children }) => {
111113
client.service('agents').command(command)
112114
})
113115

114-
const unsubscribeMessage = subscribe(events.MESSAGE_AGENT, (event, data) => {
115-
client.service('agents').message(data)
116-
})
116+
const unsubscribeMessage = subscribe(
117+
events.MESSAGE_AGENT,
118+
(event, data) => {
119+
client.service('agents').message(data)
120+
}
121+
)
117122

118123
return () => {
119124
unsubscribeRun()
120125
unsubscribeCommand()
121126
unsubscribeMessage()
122-
123127
}
124128
}, [client])
125129

0 commit comments

Comments
 (0)