Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(clientOptions?: OffixClientConfig) {
if (clientOptions && clientOptions.storage) {
this.cacheStorage = clientOptions.storage;
this.offlineStorage = clientOptions.storage;
} else {
this.cacheStorage = createDefaultCacheStorage();
this.offlineStorage = createDefaultOfflineStorage();
}
this.networkStatus = (isMobileCordova()) ?
new CordovaNetworkStatus() : new WebNetworkStatus();
if (clientOptions && clientOptions.conflictStrategy) {
this.conflictStrategy = clientOptions.conflictStrategy;
} else {
this.conflictStrategy = UseClient;
}
Object.assign(this, clientOptions);
}
}
constructor(options: OffixOptions) {
this.executor = options.executor || new DefaultOffixExecutor();
if (options.networkStatus) {
this.networkStatus = options.networkStatus;
} else {
this.networkStatus = (isMobileCordova()) ?
new CordovaNetworkStatus() : new WebNetworkStatus();
}
this.offlineStorage = options.storage || createDefaultOfflineStorage();
this.serializer = options.serializer || new DefaultOfflineSerializer();
this.offlineQueueListener = options.offlineQueueListener;
}
}
constructor(clientOptions?: OffixClientConfig) {
if (clientOptions && clientOptions.storage) {
this.cacheStorage = clientOptions.storage;
this.offlineStorage = clientOptions.storage;
} else {
this.cacheStorage = createDefaultCacheStorage();
this.offlineStorage = createDefaultOfflineStorage();
}
this.networkStatus = (isMobileCordova()) ?
new CordovaNetworkStatus() : new WebNetworkStatus();
if (clientOptions && clientOptions.conflictStrategy) {
this.conflictStrategy = clientOptions.conflictStrategy;
} else {
this.conflictStrategy = UseClient;
}
Object.assign(this, clientOptions);
}
}