Gets the Redux store from Svelte context. Note that you should normally not need to use this unless you need to call replaceReducer or perform some other operation that requires access to the entire store.
replaceReducer
Redux state definition.
The Redux store from Svelte context.
<script> import { useStore } from "@laserware/sword"; import { someAction } from "./my-redux-actions"; const store = useStore(); function handleClick() { console.log(store.getState()); // Returns state store.dispatch(someAction()); }</script><button onclick={handleClick}>Click Me</button> Copy
<script> import { useStore } from "@laserware/sword"; import { someAction } from "./my-redux-actions"; const store = useStore(); function handleClick() { console.log(store.getState()); // Returns state store.dispatch(someAction()); }</script><button onclick={handleClick}>Click Me</button>
Gets the Redux store from Svelte context. Note that you should normally not need to use this unless you need to call
replaceReducer
or perform some other operation that requires access to the entire store.