Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
DataService.prototype.createSelectors = function () {
var selectors = _super.prototype.createSelectors.call(this);
var getServiceState = selectors.getServiceState;
var getAllItems = reselect_1.createSelector(getServiceState, function (store) { return store.items; });
var getRequestCache = re_reselect_1.default(getServiceState, function (state, queryParams) { return queryParams; }, function (store, queryParams) { return store.requestCache.get(hash(queryParams || {})); })(function (state, queryParams) { return hash(queryParams || {}); });
var getItems = re_reselect_1.default(getAllItems, function (state, queryParams) { return getRequestCache(state, queryParams); }, function (items, requestCache) { return requestCache ? requestCache.ids.map(function (id) { return items.get(id); }).valueSeq() : null; })(function (state, queryParams) { return hash(queryParams || {}); });
var getItemsByIds = re_reselect_1.default(function (state, ids) { return ids; }, getAllItems, function (ids, items) {
return ids
.map(function (id) { return items.get(id); })
.filter(function (item) { return item != null; });
})(function (state, ids) { return JSON.stringify(ids.sort()); });
var getItem = re_reselect_1.default(getAllItems, function (state, id) { return id; }, function (items, id) { return items.get(id); })(function (state, id) { return id; });
return __assign({}, selectors, { getAllItems: getAllItems,
getItem: getItem,
getItems: getItems,
getItemsByIds: getItemsByIds,
getRequestCache: getRequestCache });
};
DataService.prototype.createReducers = function () {
DataService.prototype.createSelectors = function () {
var selectors = _super.prototype.createSelectors.call(this);
var getServiceState = selectors.getServiceState;
var getAllItems = reselect_1.createSelector(getServiceState, function (store) { return store.items; });
var getRequestCache = re_reselect_1.default(getServiceState, function (state, queryParams) { return queryParams; }, function (store, queryParams) { return store.requestCache.get(hash(queryParams || {})); })(function (state, queryParams) { return hash(queryParams || {}); });
var getItems = re_reselect_1.default(getAllItems, function (state, queryParams) { return getRequestCache(state, queryParams); }, function (items, requestCache) { return requestCache ? requestCache.ids.map(function (id) { return items.get(id); }).valueSeq() : null; })(function (state, queryParams) { return hash(queryParams || {}); });
var getItemsByIds = re_reselect_1.default(function (state, ids) { return ids; }, getAllItems, function (ids, items) {
return ids
.map(function (id) { return items.get(id); })
.filter(function (item) { return item != null; });
})(function (state, ids) { return JSON.stringify(ids.sort()); });
var getItem = re_reselect_1.default(getAllItems, function (state, id) { return id; }, function (items, id) { return items.get(id); })(function (state, id) { return id; });
return __assign({}, selectors, { getAllItems: getAllItems,
getItem: getItem,
getItems: getItems,
getItemsByIds: getItemsByIds,
getRequestCache: getRequestCache });
};
DataService.prototype.createReducers = function () {
DataService.prototype.createSelectors = function () {
var selectors = _super.prototype.createSelectors.call(this);
var getServiceState = selectors.getServiceState;
var getAllItems = reselect_1.createSelector(getServiceState, function (store) { return store.items; });
var getRequestCache = re_reselect_1.default(getServiceState, function (state, queryParams) { return queryParams; }, function (store, queryParams) { return store.requestCache.get(hash(queryParams || {})); })(function (state, queryParams) { return hash(queryParams || {}); });
var getItems = re_reselect_1.default(getAllItems, function (state, queryParams) { return getRequestCache(state, queryParams); }, function (items, requestCache) { return requestCache ? requestCache.ids.map(function (id) { return items.get(id); }).valueSeq() : null; })(function (state, queryParams) { return hash(queryParams || {}); });
var getItemsByIds = re_reselect_1.default(function (state, ids) { return ids; }, getAllItems, function (ids, items) {
return ids
.map(function (id) { return items.get(id); })
.filter(function (item) { return item != null; });
})(function (state, ids) { return JSON.stringify(ids.sort()); });
var getItem = re_reselect_1.default(getAllItems, function (state, id) { return id; }, function (items, id) { return items.get(id); })(function (state, id) { return id; });
return __assign({}, selectors, { getAllItems: getAllItems,
getItem: getItem,
getItems: getItems,
getItemsByIds: getItemsByIds,
getRequestCache: getRequestCache });
};
DataService.prototype.createReducers = function () {