How to use @wora/offline-first - 4 common examples

To help you get started, we’ve selected a few @wora/offline-first examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github morrys / wora / packages / apollo-offline / src / ApolloStoreOffline.ts View on Github external
public static create(persistOptions: CacheOptions = {}): IApolloStoreOffline {
        const persistOptionsStoreOffline = {
            prefix: 'apollo-offline',
            serialize: true,
            ...persistOptions,
        };
        const storeOffline = new OfflineFirst(persistOptionsStoreOffline);
        return {
            storeOffline,
            publish,
            setOfflineOptions,
        };
    }
}
github morrys / offline-examples / apollo / todo / client / src / apollo / OfflineFirstApollo.js View on Github external
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);
    }
}
github morrys / wora / packages / relay-offline / src / OfflineFirstRelay.ts View on Github external
public static create(persistOptions: CacheOptions = {}): IRelayStoreOffline {
        {
            const persistOptionsStoreOffline = {
                prefix: 'relay-offline',
                serialize: true,
                ...persistOptions,
            };

            const storeOffline = new OfflineFirst(persistOptionsStoreOffline);
            return {
                storeOffline,
                publish,
                setOfflineOptions,
            };
        }
    }
}
github morrys / react-relay-offline / src / runtime / OfflineFirstRelay.ts View on Github external
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);    
    }
}

@wora/offline-first

@wora Offline First

MIT
Latest version published 4 years ago

Package Health Score

45 / 100
Full package analysis

Popular @wora/offline-first functions