WebediaGaming / react-nexus

Real world apps with React.
483 stars 20 forks source link

Feature keep value #41

Closed antca closed 8 years ago

antca commented 8 years ago

I discussed with @mrtbld and he convinced me that it was maybe a good idea to set the values of PENDING and REJECTED States to the last one of the store. For PENDING it's quite logical actually (because it's a state transiton :wink:). And for REJECTED it can be quite handy to be able to display something to the user (if it's relevant) when an error occur.

It's materialized as a default value as first argument when creating States.

I cleaned a bit the "fetch" code for the HTTPStore and set unitialized MemoryStore's path to a REJECTED State rather than a PENDING one.

I realize that the project need more tests because even with some breaking changes, only a few tests were broken.

This PR is obviously open to any discussion. The goal is to make the API of react-nexus nicer.