Open jcroll opened 7 years ago
The documentation is wrong: the code implements the current FSA spec, success would be the absence of error: true.
Absence of error can also mean a request has never been initiated.
I wrote additional code to aid with this that basically decorated the FSA spec.
IMO the spec is not verbose enough and should accommodate these additional states.
redux-promise doesn't dispatch when it initiates the request though, so your reducer will not receive an action when it's fetching, only once it's completed or failed. You might want to try a different middleware (like https://github.com/pburtchaell/redux-promise-middleware) for an approach that accommodates knowing when something's fetching.
@mateomurphy ,u are right, i write a demo and test it, in my case there is no 'status', the right result is :
action:{
type:xxx,
payload:{xxx}
}
action:{
type:xxx,
payload:{xxx},
error:true
}
so we just can only use error
as a condition to judge it.
In your documentation it says:
I see no other mention of this status field anywhere in the code of this library and I have not seen any field in my resolved action in my testing of this library.
There is a field called
error
but I am more interested in knowing whether there has been a successful request.Does it still exist or perhaps this is legacy from and earlier spec of FSA?
I ask b/c I am looking for a way to use FSA to determine if an action is in the process of making a request (e.g.
isFetching
) how to do this?