Map actions to methods with included dispatch
Map actions to methods with included dispatch
```
npm install --save @hmn/use-actions
`javascript`
import useActions from '@hmn/use-actions'
`jsx
import reducer from './reducer'
const mapDispatch = {
setItems: (items) => ({
type: 'SET_ITEMS',
items
}),
removeItem: () => ({
type: 'REMOVE_ITEM'
}),
}
const Demo = () => {
const [state, { setItems, removeItem }] = useActions(reducer, mapDispatch)
return null
}
render(
``