This method is very handy with functional components, but the arguments are given by does not include the action event, for example:
- Let's say we dispatch this event:
storage.dispatch({type: 'EVENT', data: 'hello'})
- Using sotrage.on function
storage.on('EVENT', (action, state) => {
// action.data is 'hello'
})
Div({}, 'text').onStoreEvent('EVENT', (state, thisEl) => {
// here I can not get the action.data
})
New feature request: it would be useful to have the action event in the functional onStoreEvent.
This method is very handy with functional components, but the arguments are given by does not include the action event, for example:
New feature request: it would be useful to have the action event in the functional onStoreEvent.