single-source.dispatch({path, payload:func})

node v8.17.0
version: 1.0.0
endpointsharetweet
const createStore = require('single-source').createStore; const ITEMS = 'items'; const initialState = { items: [1, 2, 3, 4], currentLanguage: 'en', }; const myStore = createStore(initialState); const square = currentItemsArray => currentItemsArray.map(n => n * n); myStore.dispatch({ path: ITEMS, payload: square, }); myStore.getState();
Loading…

no comments

    sign in to comment