I discussed with @mrtbld and he convinced me that it was maybe a good idea to set the values of PENDING and REJECTEDStates 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 REJECTEDState 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.
I discussed with @mrtbld and he convinced me that it was maybe a good idea to set the values of
PENDING
andREJECTED
State
s to the last one of the store. ForPENDING
it's quite logical actually (because it's a state transiton :wink:). And forREJECTED
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
State
s.I cleaned a bit the "fetch" code for the
HTTPStore
and set unitializedMemoryStore
's path to aREJECTED
State
rather than aPENDING
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.