Skip to content

Pass action to subscribe() listeners #1786

Closed
@rstacruz

Description

@rstacruz

It'd be nice to be able to learn what actions trigger a subscribe() event:

store.subscribe(action => {
  if (action.type === '...') {
    /* do something */
  }
})

This way you can create listener services that wait for a certain action to do something. Example use case is to send Google Analytics data when ROUTE_CHANGE occurs (assuming your router sends this out).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions