How to use the rx.Observable.fromNodeCallback function in rx

To help you get started, we’ve selected a few rx 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 tierratelematics / prettygoat / scripts / snapshots / CassandraSnapshotRepository.ts View on Github external
private setupClient() {
        if (!this.execute) {
            let client = this.clientFactory.clientFor(this.config);
            this.execute = Observable.fromNodeCallback(client.execute, client);
        }
    }
github freeCodeCamp / freeCodeCamp / api-server / common / models / user.js View on Github external
function destroyAll(id, Model) {
  return Observable.fromNodeCallback(Model.destroyAll, Model)({ userId: id });
}
github freeCodeCamp / freeCodeCamp / api-server / common / models / user.js View on Github external
User.on('dataSourceAttached', () => {
    User.findOne$ = Observable.fromNodeCallback(User.findOne, User);
    User.count$ = Observable.fromNodeCallback(User.count, User);
    User.create$ = Observable.fromNodeCallback(User.create.bind(User));
    User.prototype.createAccessToken$ = Observable.fromNodeCallback(
      User.prototype.createAccessToken
    );
  });
github freeCodeCamp / freeCodeCamp / api-server / common / models / user.js View on Github external
User.on('dataSourceAttached', () => {
    User.findOne$ = Observable.fromNodeCallback(User.findOne, User);
    User.count$ = Observable.fromNodeCallback(User.count, User);
    User.create$ = Observable.fromNodeCallback(User.create.bind(User));
    User.prototype.createAccessToken$ = Observable.fromNodeCallback(
      User.prototype.createAccessToken
    );
  });
github freeCodeCamp / freeCodeCamp / api-server / common / models / user.js View on Github external
User.on('dataSourceAttached', () => {
    User.findOne$ = Observable.fromNodeCallback(User.findOne, User);
    User.count$ = Observable.fromNodeCallback(User.count, User);
    User.create$ = Observable.fromNodeCallback(User.create.bind(User));
    User.prototype.createAccessToken$ = Observable.fromNodeCallback(
      User.prototype.createAccessToken
    );
  });
github freeCodeCamp / freeCodeCamp / api-server / common / models / popularity.js View on Github external
Popularity.on('dataSourceAttached', () => {
    Popularity.findOne$ = Observable.fromNodeCallback(
      Popularity.findOne,
      Popularity
    );
    Popularity.findById$ = Observable.fromNodeCallback(
      Popularity.findById,
      Popularity
    );
    Popularity.find$ = Observable.fromNodeCallback(Popularity.find, Popularity);
  });
};
github freeCodeCamp / freeCodeCamp / server / middlewares / migrate-completed-challenges.js View on Github external
.flatMap(challengeMap => {
      const updateData = {
        '$set': {
          challengeMap,
          isChallengeMapMigrated: true
        }
      };
      return Observable.fromNodeCallback(User.updateAll, User)(
        { id: userId },
        updateData,
        { allowExtendedOperators: true }
      );
    });
}
github freeCodeCamp / freeCodeCamp / api-server / common / models / user.js View on Github external
User.prototype.createAuthToken = function createAuthToken({ ttl } = {}) {
    return Observable.fromNodeCallback(
      this.authTokens.create.bind(this.authTokens)
    )({ ttl });
  };