Skip to content

HTMLElement.prototype.onStoreEvent #45

@oreyes1991

Description

@oreyes1991

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'
    })
  • Using onStoreEvent
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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions