How to use the simperium function in simperium

To help you get started, we’ve selected a few simperium 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 Automattic / simplenote-electron / lib / simperium / index.js View on Github external
function BrowserClient({ appID, token, bucketConfig, database, version }) {
  this.databaseName = database || 'simperium-objects';
  this.databaseVersion = version || 1;
  let config = (this.bucketConfig = bucketConfig);
  this.bucketDB = store_provider(this.configureDb.bind(this));
  this.buckets = {};

  let objectStoreProvider = this.bucketDB.provider();
  this.ghostStore = ghost_store;

  this.client = simperium(appID, token, {
    ghostStoreProvider: ghost_store,
    objectStoreProvider: function(bucket) {
      var store = objectStoreProvider.apply(null, arguments);
      if (config[bucket.name].beforeIndex) {
        store.beforeIndex = config[bucket.name].beforeIndex;
      }
      return store;
    },
  });

  [
    'send',
    'message',
    'connect',
    'reconnect',
    'disconnect',

simperium

A simperium client for node.js

BSD-2-Clause
Latest version published 3 years ago

Package Health Score

52 / 100
Full package analysis