Skip to content

Commit

Permalink
fix: export persistCacheSync explicitly
Browse files Browse the repository at this point in the history
  • Loading branch information
wtrocki authored Oct 23, 2019
1 parent 22c94cc commit 755b94c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/persistCacheSync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,20 @@ import CachePersistor from './CachePersistor';
import Persistor, { PersistorConfig } from './Persistor';
import Storage from './Storage';

export default <T>(options: ApolloPersistOptions<T>) => {
/**
* Add cache to persist engine using synchronous API
*
* @see SynchronousCachePersistor for advanced use cases
* @param options options for persist engine
*/
export const persistCacheSync = <T>(options: ApolloPersistOptions<T>) => {
const cachePersistor = new SynchronousCachePersistor(options);
cachePersistor.restoreSync();
};

/**
* Persistor engine that is going to use synchronous api
*/
export class SynchronousCachePersistor<T> extends CachePersistor<T> {
persistor: SynchronousPersistor<T>;

Expand Down

0 comments on commit 755b94c

Please sign in to comment.