MCPcopy Index your code
hub / github.com/continuedev/continue / getEmptyRootState

Function getEmptyRootState

gui/src/util/test/mockStore.ts:26–51  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

24
25// TODO remove non-serializable streamAborter, causes headaches
26export const getEmptyRootState: () => RootState = () => {
27 const withoutSession: Omit<RootState, "session"> = {
28 config: INITIAL_CONFIG_SLICE,
29 ui: DEFAULT_UI_SLICE,
30 editModeState: INITIAL_EDIT_STATE,
31 indexing: INITIAL_INDEXING_STATE,
32 profiles: INITIAL_PROFILES_STATE,
33 tabs: INITIAL_TABS_STATE,
34 };
35 const { streamAborter, ...serializableSession } = INITIAL_SESSION_STATE;
36 const sessionCopy = copyOf(serializableSession) as Omit<
37 RootState["session"],
38 "streamAborter"
39 >;
40 const withoutSessionCopy = copyOf(withoutSession) as Omit<
41 RootState,
42 "session"
43 >;
44 return {
45 ...withoutSessionCopy,
46 session: {
47 ...sessionCopy,
48 streamAborter: new AbortController(),
49 },
50 };
51};
52
53export const createMockStore = (
54 initialState?: Partial<RootState>,

Callers 3

getRootStateWithClaudeFunction · 0.90
createMockStoreFunction · 0.85

Calls 1

copyOfFunction · 0.90

Tested by 1

getRootStateWithClaudeFunction · 0.72