Comment on page
requestStatuses
An object that represents the four statuses that a request can have. The complete object is shown below:
{
IDLE: 'IDLE',
PENDING: 'PENDING',
FAILED: 'FAILED',
SUCCEEDED: 'SUCCEEDED',
}
import { requestStatuses } from 'redux-resource';
import store from './store';
const state = store.getState();
if (state.books.meta['23'].readStatus === requestStatuses.PENDING) {
console.log('A book with id "23" is currently being fetched.');
}
- Although this object can be used to check the status of a request in yourfor that purpose. For this reason, we recommend restricting your usage of thisobject to plugins, reducers, or action creators.
Last modified 5yr ago