MCPcopy
hub / github.com/statelyai/xstate / createStoreLogic

Function createStoreLogic

packages/xstate-store/src/store.ts:728–751  ·  view source on GitHub ↗
(
  config: StoreConfig<any, any, any, any, any, any> & {
    context: StoreContext | ((input: unknown) => StoreContext);
    selectors?: StoreSelectorsConfig<any>;
  }
)

Source from the content-addressed store, hash-verified

726 {}
727>;
728export function createStoreLogic(
729 config: StoreConfig<any, any, any, any, any, any> & {
730 context: StoreContext | ((input: unknown) => StoreContext);
731 selectors?: StoreSelectorsConfig<any>;
732 }
733): any {
734 return {
735 createStore(input?: unknown) {
736 const context =
737 typeof config.context === 'function'
738 ? config.context(input)
739 : config.context;
740
741 const store = createStore({
742 ...config,
743 context
744 });
745
746 return config.selectors
747 ? attachSelectors(store, config.selectors)
748 : store;
749 }
750 };
751}
752
753declare global {
754 interface SymbolConstructor {

Callers 8

index.test.tsxFile · 0.90
types.test.tsxFile · 0.90
types.test.tsxFile · 0.90
store.test.tsFile · 0.90
index.test.tsFile · 0.90
index.test.tsFile · 0.90
index.test.tsxFile · 0.90
index.test.tsxFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…