UNPKG

electron-shared-state

Version:

❤️ easily sharing state across electron main and renderer processes.

13 lines (10 loc) 390 B
import { Objectish } from 'immer/dist/internal'; interface Options { name?: string; } declare function createSharedStore<T extends Objectish>(state: T, options?: Options): { setState: (recipe: (draft: T) => void, description?: string) => T; getState: () => T; subscribe: (listener: (state: T, description?: string) => void) => () => void; }; export { createSharedStore };