Names
Motivation
Specifying a Request Name
import { actionTypes } fom 'redux-resource';
import store from './store';
store.dispatch({
type: actionTypes.READ_RESOURCES_PENDING,
resourceType: 'books',
// In this situation, we are generating a key. It could be a random string of data,
// which makes debugging hard.
requestKey: generateRequestKey(/* request data */),
// By specifying a human-readable name, we are helping future developers out who are
// debugging our application.
requestName: 'searchBooks'
});Last updated