Skip to main content

createDocStore

Creates a SyncState store that holds your document/app state. There should only be a single store in your app.

Arguments#

  1. initialDoc (Object): The initial document/state.

Returns#

(store): An object that holds a document representing the complete state of your app.

Example#

import { createDocStore } from "@syncstate/core";
import history from "@syncstate/history";
const store = createDocStore({ todos: [], filter: "all" }, [
history.createInitializer(),
]);
Last updated on by RohitGeekyAnts