mirror of
https://github.com/a2nt/webpack-bootstrap-ui-kit.git
synced 2024-09-30 05:09:04 +02:00
20 lines
623 B
JavaScript
20 lines
623 B
JavaScript
|
import { InMemoryCache } from '@apollo/client';
|
||
|
|
||
|
//import { IonicStorageModule } from '@ionic/storage';
|
||
|
//import { persistCache, IonicStorageWrapper } from 'apollo3-cache-persist';
|
||
|
import { persistCacheSync, LocalStorageWrapper } from 'apollo3-cache-persist';
|
||
|
|
||
|
const cache = new InMemoryCache();
|
||
|
|
||
|
// await before instantiating ApolloClient, else queries might run before the cache is persisted
|
||
|
//await persistCache({
|
||
|
persistCacheSync({
|
||
|
cache,
|
||
|
storage: new LocalStorageWrapper(window.localStorage),
|
||
|
key: 'web-persist',
|
||
|
maxSize: 1048576, // 1Mb
|
||
|
//new IonicStorageWrapper(IonicStorageModule),
|
||
|
});
|
||
|
|
||
|
export { cache };
|