Redux-Leaves: bundling actions

node v10.24.1
version: 2.0.0
endpointsharetweet
const { createStore } = require('redux') const { reduxLeaves, bundle } = require('redux-leaves') const initialState = { list: ['a', 'b'], nested: { counter: 0, state: { deep: 'somewhat' } } } const [reducer, actions] = reduxLeaves(initialState) const store = createStore(reducer) store.getState()
const actionBundle = bundle([ actions.list.create.push('c'), actions.nested.counter.create.increment(5), actions.nested.state.create.set('arbitrary', true) ]) store.dispatch(actionBundle) store.getState()
Loading…

no comments

    sign in to comment