Skip to content

setState should support callbacks, same as the typical react setState #544

@steventnorris-40AU

Description

@steventnorris-40AU

Currently, reflux setState does not support a callback. I believe expected functionality here would be that it worked like or better than the typical React setState.

Suggestion:
Set expected completions based on number of subscribed components.
While looping setState for all subscribed components, fire off a callback on that component's setState indicating it is complete.
When all completions are reached, fire the callback for the reflux store's setState.

I believe this could also be wrapped as a promise instead of a callback. Honestly, I'm not sure why the normal React setState is a callback and not a promise.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions