MCPcopy
hub / github.com/simstudioai/sim / resetAllStores

Function resetAllStores

apps/sim/stores/index.ts:18–42  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

16 * Reset all Zustand stores and React Query caches to initial state.
17 */
18export const resetAllStores = () => {
19 useWorkflowRegistry.setState({
20 activeWorkflowId: null,
21 error: null,
22 hydration: {
23 phase: 'idle',
24 workspaceId: null,
25 workflowId: null,
26 requestId: null,
27 error: null,
28 },
29 })
30 useWorkflowStore.getState().clear()
31 useSubBlockStore.getState().clear()
32 getQueryClient().removeQueries({ queryKey: environmentKeys.all })
33 useExecutionStore.getState().reset()
34 useTerminalConsoleStore.setState({
35 workflowEntries: {},
36 entryIdsByBlockExecution: {},
37 entryLocationById: {},
38 isOpen: false,
39 })
40 consolePersistence.persist()
41 useMothershipDraftsStore.setState({ drafts: {} })
42}
43
44/**
45 * Clear all user data when signing out.

Callers 1

clearUserDataFunction · 0.85

Calls 3

getQueryClientFunction · 0.90
persistMethod · 0.80
clearMethod · 0.65

Tested by

no test coverage detected