Sha256: 18e6e93e3d4a45569b92b067bf144149f0f915fd34cc81dff5527e2882aebdf7
Contents?: true
Size: 721 Bytes
Versions: 82
Compression:
Stored size: 721 Bytes
Contents
import { STATUS } from '../../constants'; export const selectAPI = state => state.API || {}; export const selectAPIByKey = (state, key) => selectAPI(state)[key] || {}; export const selectAPIStatus = (state, key) => selectAPIByKey(state, key).status; export const selectAPIPayload = (state, key) => selectAPIByKey(state, key).payload || {}; export const selectAPIResponse = (state, key) => selectAPIByKey(state, key).response || {}; export const selectAPIError = (state, key) => selectAPIStatus(state, key) === STATUS.ERROR ? selectAPIResponse(state, key) : null; export const selectAPIErrorMessage = (state, key) => { const error = selectAPIError(state, key); return error && error.message; };
Version data entries
82 entries across 82 versions & 1 rubygems