Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
console.log(idbStorages);
const CacheLocalIDBNO = new Cache({
prefix: null,
serialize: false,
storage: idbStorageNo[0],
});
const CacheLocalIDB = new Cache({
layers: [filterNoPersistReplace],
serialize: false,
storage: idbStorages[0],
});
const CacheLocalIDB2 = new Cache({
layers: [filterPersistReplace],
serialize: false,
storage: idbStorages[1],
});
const CacheLocalDisable = new Cache({
disablePersist: true
});
const App = () => {
return
const StyledApp = styled.div`
display: flex;
justify-content: center;
flex-direction: column-reverse;
`;
const filterPersistReplace: ILayer = filterKeys(key => key.includes("replace"));
const filterNoPersistReplace: ILayer = filterKeys(key => !key.includes("replace"));
const CacheLocal = new Cache({
layers: [filterNoPersistReplace],
});
const CacheLocalNew = new Cache({
errorHandling: (error) => {
console.log("error", error);
return true;
},
layers: [filterPersistReplace],
prefix: 'cachenew',
});
const CacheSessionNew = new Cache({
prefix: 'cachenew',
webStorage: 'session'
});
const idbStorages: CacheStorage[] = IDBStorage.create( {
name: "cache",
onUpgrade: (db, oldv, newv, transaction) => {
const filterNoPersistReplace: ILayer = filterKeys(key => !key.includes("replace"));
const CacheLocal = new Cache({
layers: [filterNoPersistReplace],
});
const CacheLocalNew = new Cache({
errorHandling: (error) => {
console.log("error", error);
return true;
},
layers: [filterPersistReplace],
prefix: 'cachenew',
});
const CacheSessionNew = new Cache({
prefix: 'cachenew',
webStorage: 'session'
});
const idbStorages: CacheStorage[] = IDBStorage.create( {
name: "cache",
onUpgrade: (db, oldv, newv, transaction) => {
console.log("onUpgrade", db, oldv, newv, transaction);
},
storeNames: ["persist", "persist2"],
version: 1,
});
const idbStorageNo: CacheStorage[] = IDBStorage.create( {
name: "nocache",
-moz-osx-font-smoothing: grayscale;
font-weight: 300;
}
`
const StyledApp = styled.div`
display: flex;
justify-content: center;
flex-direction: column-reverse;
`;
const filterPersistReplace: ILayer = filterKeys(key => key.includes("replace"));
const filterNoPersistReplace: ILayer = filterKeys(key => !key.includes("replace"));
const CacheLocal = new Cache({
layers: [filterNoPersistReplace],
});
const CacheLocalNew = new Cache({
errorHandling: (error) => {
console.log("error", error);
return true;
},
layers: [filterPersistReplace],
prefix: 'cachenew',
});
const CacheSessionNew = new Cache({
prefix: 'cachenew',
webStorage: 'session'
});
storeNames: ["persist"],
version: 1,
});
console.log(idbStorages[0]);
console.log(idbStorages);
const CacheLocalIDBNO = new Cache({
prefix: null,
serialize: false,
storage: idbStorageNo[0],
});
const CacheLocalIDB = new Cache({
layers: [filterNoPersistReplace],
serialize: false,
storage: idbStorages[0],
});
const CacheLocalIDB2 = new Cache({
layers: [filterPersistReplace],
serialize: false,
storage: idbStorages[1],
});
const CacheLocalDisable = new Cache({
disablePersist: true
});
serialize: true,
...persistOptions,
...persistOptionsOptimistics,
}
const idbStorages: CacheStorage[] = IDBStorage.create("relay", ["roots", "cache"]);
const idb: CacheOptions = {
storage: idbStorages[0],
serialize: false,
}
const idb1: CacheOptions = {
storage: idbStorages[1],
serialize: false,
}*/
this.cache = new Cache(persistOptions);
}
...persistOptionsRecords,
}
/*const idbStorages: CacheStorage[] = IDBStorage.create("relay", ["roots", "cache"]);
const idb: CacheOptions = {
storage: idbStorages[0],
serialize: false,
}
const idb1: CacheOptions = {
storage: idbStorages[1],
serialize: false,
}*/
const cacheRecordSource = new Cache(persistOptionsRecordSource);
const cache = new Cache(persistOptionsStore);
this._recordSource = new RecordSource(cacheRecordSource);
this._cache = cache;
}
...persistOptions,
...persistOptionsRecords,
}
/*const idbStorages: CacheStorage[] = IDBStorage.create("relay", ["roots", "cache"]);
const idb: CacheOptions = {
storage: idbStorages[0],
serialize: false,
}
const idb1: CacheOptions = {
storage: idbStorages[1],
serialize: false,
}*/
const cacheRecordSource = new Cache(persistOptionsRecordSource);
const cache = new Cache(persistOptionsStore);
this._recordSource = new RecordSource(cacheRecordSource);
this._cache = cache;
}
constructor(options: InMemoryCacheConfig = {}, persistOptions: CacheOptions = {}) {
super(options);
const persistOptionsApollo = {
prefix: 'apollo-cache',
serialize: true,
...persistOptions,
};
this.cache = new Cache(persistOptionsApollo);
(this.cache as any).toObject = (): Readonly<{
[key: string]: any;
}> => this.cache.getState();
(this.cache as any).clear = (): void => this.cache.purge();
(this as any).data = this.cache;
(this as any).optimisticData = this.cache;
}
});
const CacheLocalIDB = new Cache({
layers: [filterNoPersistReplace],
serialize: false,
storage: idbStorages[0],
});
const CacheLocalIDB2 = new Cache({
layers: [filterPersistReplace],
serialize: false,
storage: idbStorages[1],
});
const CacheLocalDisable = new Cache({
disablePersist: true
});
const App = () => {
return
}