Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function addFetch(
ResourceStore,
{
actionsKey = `${lowerCaseFirst(this.name)}Actions`
}
) {
const {methodNames, name, plural} = this;
const {getMany, getSingle} = methodNames;
const refreshMany = `refresh${plural}`;
const refreshSingle = `refresh${name}`;
return class ResourceStoreWithFetch extends ResourceStore {
getActions() {
return this.app[actionsKey];
}
[getMany](options, {refresh} = {}) {
return this.fetch({
id: `c${this.collectionKey(options)}`,