Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public static create(persistOptions: CacheOptions = {}): IApolloStoreOffline {
const persistOptionsStoreOffline = {
prefix: 'apollo-offline',
serialize: true,
...persistOptions,
};
const storeOffline = new OfflineFirst(persistOptionsStoreOffline);
return {
storeOffline,
publish,
setOfflineOptions,
};
}
}
const persistOptionsStoreOffline = {
prefix: 'apollo-offline',
serialize: true,
...persistOptions,
};
const { onComplete, onDiscard, link, manualExecution } = offlineOptions;
const options = {
manualExecution,
execute: (offlineRecord) => executeMutation(client, link, offlineRecord),
onComplete: (options) => complete(client, onComplete, options),
onDiscard: (options) => discard(client, onDiscard, options),
//onDispatch: (request: any) => undefined,
}
return new OfflineFirst(options, persistOptionsStoreOffline);
}
}
public static create(persistOptions: CacheOptions = {}): IRelayStoreOffline {
{
const persistOptionsStoreOffline = {
prefix: 'relay-offline',
serialize: true,
...persistOptions,
};
const storeOffline = new OfflineFirst(persistOptionsStoreOffline);
return {
storeOffline,
publish,
setOfflineOptions,
};
}
}
}
onPublish
} = offlineOptions;
const options: OfflineFirstOptions = {
manualExecution,
execute: (offlineRecord: any) => executeMutation(environment, network, offlineRecord),
onComplete: (options: any) => complete(environment, onComplete, options),
onDiscard: (options: any) => discard(environment, onDiscard, options),
}
if(onPublish) {
options.onPublish = onPublish;
}
if(finish) {
options.finish = finish;
}
return new OfflineFirst(options, persistOptionsStoreOffline);
}
}