state(Object): Typically, the current state of the Redux store, but more generally it can be any object that has a request status somewhere deeply nested within it.
statusLocation(String|Array): A single path that points to a request status within
state. If you pass an array of status locations, then they will be aggregated. For more on status locations and status aggregation, see the Notes below.
treatIdleAsPending] (Boolean): Whether or not a request status of
IDLEis to be considered as a
pendingrequest. Defaults to
false. See Tips on when to use this.
Object): An Object representing the status of this request for the statusLocation. It has the following shape:
true, reflecting the value of the request status. When
true, then request statuses that are
"IDLE"will be returned as
Keep in mind that
treatIdleAsPendingalso works when aggregating.
treatIdleAsPending, is useful for requests that are made when your components mount. The components will often render before the request begins, so the status of these requests will be
treatIdleAsPendingwill consider these
mapStateToProps, and then passing them in as props into your component. That way, you have access to this information in all of the lifecycle methods of your component.
state, doesn't always need to be the state of your Redux store. For instance, if you're using this method within your component's lifecycle methods, such as
componentDidUpdate, you may instead pass it an object that is a subset of the state. This can be useful when you're comparing a previous status against the current status.