@stories-js/core
Version:
Stories web components to build stories
44 lines • 1.23 kB
JavaScript
/*!
* (C) StoriesJS https://storiesjs.org - GPL-2.0 License
*/
import { createStore as createStencilStore } from "@stencil/store";
/**
* Create store
* @param defaultState Default state
* @returns
*/
export function createStore(defaultState) {
return createStencilStore(defaultState);
}
const store = createStore({
stories: {},
story: undefined,
context: undefined,
notifications: [],
zoom: 1.0,
showNav: true,
showToolbar: true,
showPanel: true,
fullScreen: false,
panelPosition: 'bottom',
singleStory: true,
enableShortcuts: true,
theme: '',
selectedPanel: undefined,
addons: {},
});
/**
* Proxied object that will detect dependencies and call the subscriptions and computed properties.
* If available, it will detect from which Stencil Component it was called and rerender it when the property changes.
*/
export const state = store.state;
/**
* Resets the state to its original state and signals a dispose event to all the plugins.
* This method is intended for plugins to reset all their internal state between tests.
*/
export const dispose = store.dispose;
/**
* Resets the state to its original state
*/
export const reset = store.reset;
//# sourceMappingURL=index.js.map