How to use offix-offline - 3 common examples

To help you get started, we’ve selected a few offix-offline 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 aerogear / offix / packages / offix-client / src / config / OffixDefaultConfig.ts View on Github external
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);
  }
}
github aerogear / offix / packages / offix-scheduler / src / config / OffixConfig.ts View on Github external
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;
  }
}
github aerogear / offix / packages / offix-client / src / config / OffixDefaultConfig.ts View on Github external
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);
  }
}

offix-offline

Offix package that exposes network interfaces

Apache-2.0
Latest version published 4 years ago

Package Health Score

51 / 100
Full package analysis