Gets the dispatch function from the Redux store in context.
dispatch
Dispatch function that can be called with a Redux action.
<script> import { useDispatch } from "@laserware/sword"; import { someAction } from "./my-redux-actions"; const dispatch = useDispatch(); function handleClick() { dispatch(someAction()); }</script><button onclick={handleClick}>Click Me</button> Copy
<script> import { useDispatch } from "@laserware/sword"; import { someAction } from "./my-redux-actions"; const dispatch = useDispatch(); function handleClick() { dispatch(someAction()); }</script><button onclick={handleClick}>Click Me</button>
Gets the
dispatch
function from the Redux store in context.