diff --git a/packages/foundation/example/server.ts b/packages/foundation/example/server.ts index ab12d2f3..d85387cd 100644 --- a/packages/foundation/example/server.ts +++ b/packages/foundation/example/server.ts @@ -78,20 +78,14 @@ startServerStandalone({ openapiSchemaFromRealEndpoint, openapiSchemaWithModificationsForSimulation, ], - handlers({ simulationStore }) { + handlers({ store, schema, actions }) { return { getDogs: (c, req, res) => { - let dogs = simulationStore.schema.boop.select( - simulationStore.store.getState() - ); + let dogs = schema.boop.select(store.getState()); res.status(200).json({ dogs }); }, putDogs: (c, req, res) => { - simulationStore.store.dispatch( - simulationStore.actions.updater( - simulationStore.schema.boop.increment() - ) - ); + store.dispatch(actions.updater(schema.boop.increment())); res.sendStatus(200); }, }; diff --git a/packages/foundation/index.ts b/packages/foundation/index.ts index ddd6ea25..66b60fa5 100644 --- a/packages/foundation/index.ts +++ b/packages/foundation/index.ts @@ -31,11 +31,9 @@ export async function startServerStandalone< }: { openapi?: { document: Document | [Document, RecursivePartial]; - handlers: ({ - simulationStore, - }: { - simulationStore: SimulationStoreContext; - }) => Record>; + handlers: ( + simulationStore: SimulationStoreContext + ) => Record>; apiRoot?: string; }; port: number; @@ -74,7 +72,7 @@ export async function startServerStandalone< } } }; - handlerObjectRegistration(handlers({ simulationStore })); + handlerObjectRegistration(handlers(simulationStore)); api.register({ validationFail: (c, req, res) =>