Skip to content

Proposal: remove support for emitChange payloads in BaseStore #405

@mridgway

Description

@mridgway

Payloads being emitted from emitChange can cause issues where state is actually being emitted rather than letting the store be used as the source of truth. This is problematic because a component may not be set up to listen to a store when it emits the event, then after it has missed the event it renders based on the state of the store.

In short, this prevents imperative view changes based on events and forces developers to use the store state instead.

This would be a major breaking change for people that use these payloads. I'd be curious to hear use cases where they are being used for something that could not be done using store state.

Code that allows this: https://github.com/yahoo/fluxible/blob/master/packages/dispatchr/addons/BaseStore.js#L72

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions