Download mobile/modules/engine/src/stores/cloudClientStatus.ts from Anirudh1950/MentraOS: direct link, hf CLI and curl.
- Browser
- Download file 1.14 kB
-
https://huggingface.co/Anirudh1950/MentraOS/resolve/main/mobile/modules/engine/src/stores/cloudClientStatus.ts
- Command line
-
hf download hf://Anirudh1950/MentraOS/mobile/modules/engine/src/stores/cloudClientStatus.ts
-
curl -L -o cloudClientStatus.ts https://huggingface.co/Anirudh1950/MentraOS/resolve/main/mobile/modules/engine/src/stores/cloudClientStatus.ts
1.14 kB
| /** | |
| * Cloud-client runtime status store — moved into engine so engine owns the | |
| * cloud-v2 runtime status (connection status + audio transport). Re-exported | |
| * through the host's `@/stores/cloudClientStatus` shim so the app keeps its | |
| * imports, and surfaced as `engine.stores.cloudClientStatus`. | |
| */ | |
| import {create} from "zustand" | |
| import type {RuntimeAudioTransport, RuntimeSnapshot, RuntimeStatus} from "@mentra/cloud-client/react-native" | |
| const initialSnapshot: RuntimeSnapshot = { | |
| status: "disconnected", | |
| audioTransport: "none", | |
| } | |
| export interface CloudClientStatusState extends RuntimeSnapshot { | |
| lastChangedAt: Date | null | |
| setSnapshot: (snapshot: RuntimeSnapshot) => void | |
| reset: () => void | |
| } | |
| export const useCloudClientStatusStore = create<CloudClientStatusState>((set) => ({ | |
| ...initialSnapshot, | |
| lastChangedAt: null, | |
| setSnapshot: (snapshot) => | |
| set({ | |
| ...snapshot, | |
| lastChangedAt: new Date(), | |
| }), | |
| reset: () => | |
| set({ | |
| ...initialSnapshot, | |
| lastChangedAt: null, | |
| }), | |
| })) | |
| export type {RuntimeAudioTransport, RuntimeSnapshot, RuntimeStatus} | |