redux-cached-api-middleware
Version:
API caching solution for redux apps
18 lines (14 loc) • 425 B
JavaScript
import { CACHE_TYPES } from '../constants';
export var type = CACHE_TYPES.SIMPLE_SUCCESS;
export var buildStrategy = function buildStrategy() {
return { type: type };
};
export var shouldFetch = function shouldFetch(_ref) {
var state = _ref.state;
if (state) {
if (state.fetching) return false;
if (state.fetched && !state.error) return false;
}
return true;
};
//# sourceMappingURL=simpleSuccess.js.map