UNPKG

@augmentcode/ag-redux-toolkit

Version:

Redux + Saga state management for Svelte apps — designed for AI agents. Includes runtime TypeScript source, AI skills, and reference documentation for robust, observable, high-performance state management.

16 lines (15 loc) • 506 B
import { onDestroy } from "svelte"; //#region src/components-svelte/use-init-store.ts /** * Initialize the store and automatically dispose on component destroy. * Call at component init time (e.g., in root layout). * * @param store - The Store instance with registered reducers and sagas * @param initialState - Optional preloaded state */ function useInitStore(store, initialState) { onDestroy(store.init(initialState)); } //#endregion export { useInitStore }; //# sourceMappingURL=use-init-store.js.map