Skip to content

Commit a3bc55e

Browse files
committed
renaming callback
1 parent 24fdd15 commit a3bc55e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

site/src/xServices/workspace/workspaceXService.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -624,28 +624,28 @@ export const workspaceMachine = createMachine(
624624
throw Error("Cannot cancel workspace without build id")
625625
}
626626
},
627-
listenForEvents: (context) => (callback) => {
627+
listenForEvents: (context) => (send) => {
628628
if (!context.sse) {
629-
callback({ type: "SSE_ERROR", error: "error initializing sse" })
629+
send({ type: "SSE_ERROR", error: "error initializing sse" })
630630
return
631631
}
632632

633633
context.sse.addEventListener("data", (event) => {
634634
// update our data objects (workspace, resources) with each SSE that comes back from the server
635-
callback({ type: "UPDATE_EVENT", data: JSON.parse(event.data) })
635+
send({ type: "UPDATE_EVENT", data: JSON.parse(event.data) })
636636
// refresh our timeline
637-
callback({ type: "CHECK_REFRESH_TIMELINE", data: JSON.parse(event.data) })
637+
send({ type: "CHECK_REFRESH_TIMELINE", data: JSON.parse(event.data) })
638638
})
639639

640640
// handle any error events returned by our sse
641641
context.sse.addEventListener("error", (event) => {
642-
callback({ type: "SSE_ERROR", error: event })
642+
send({ type: "SSE_ERROR", error: event })
643643
})
644644

645645
// handle any sse implementation exceptions
646646
context.sse.onerror = () => {
647647
context.sse && context.sse.close();
648-
callback({ type: "SSE_ERROR", error: "sse error" })
648+
send({ type: "SSE_ERROR", error: "sse error" })
649649
}
650650

651651
},

0 commit comments

Comments
 (0)