UNPKG

redux-resource

Version:
26 lines (19 loc) 1.31 kB
'use strict'; exports.__esModule = true; var _warning = require('./warning'); var _warning2 = _interopRequireDefault(_warning); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } const requestStatuses = { IDLE: 'IDLE', PENDING: 'PENDING', FAILED: 'FAILED', SUCCEEDED: 'SUCCEEDED' }; if (process.env.NODE_ENV !== 'production') { Object.defineProperty(requestStatuses, 'NULL', { get() { (0, _warning2.default)(`You attempted to access the NULL request status from the requestStatus object ` + `that is exported from Redux Resource. The NULL request status ` + `has been renamed to IDLE in Redux Resource v3. Please update your ` + `application to use the new request status. Typically, this can be ` + `done by doing a find and replace within your source code to ` + `replace the string "NULL" with "IDLE". For more information, refer to ` + `the documentation for the request statuses at: ` + `https://redux-resource.js.org/docs/api-reference/request-statuses.html\n\n` + `Also, the migration guide to Redux Resource v3 can be found at: ` + `https://github.com/jamesplease/redux-resource/blob/master/packages/redux-resource/docs/migration-guides/2-to-3.md`, `NULL_REQUEST_STATUS_ACCESSED`); } }); } exports.default = requestStatuses;