First Release of Claw3D (#11)
Co-authored-by: iamlukethedev <iamlukethedev@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
export type GatewayStatus = "disconnected" | "connecting" | "connected";
|
||||
|
||||
export type RestartObservation = {
|
||||
sawDisconnect: boolean;
|
||||
};
|
||||
|
||||
export function observeGatewayRestart(
|
||||
prev: RestartObservation,
|
||||
status: GatewayStatus
|
||||
): { next: RestartObservation; restartComplete: boolean } {
|
||||
const sawDisconnect = prev.sawDisconnect || status !== "connected";
|
||||
return {
|
||||
next: { sawDisconnect },
|
||||
restartComplete: status === "connected" && sawDisconnect,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user