How to use the zen-observable-ts function in zen-observable-ts

To help you get started, we’ve selected a few zen-observable-ts 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 PCreations / firechat / src / apollo-link-firebase.js View on Github external
request(operation) {
    console.log(operation);
    return new Observable(observer => {
      this.promiseWorker.postMessage(operation)
        .then(data => {
          console.log('DATA', data);
          observer.next(data);
          observer.complete();
        })
        .catch(observer.error.bind(observer));
    });
  }
}
github apollographql / apollo-link / packages / apollo-link / src / linkUtils.ts View on Github external
export function fromPromise(promise: Promise): Observable {
  return new Observable(observer => {
    promise
      .then((value: T) => {
        observer.next(value);
        observer.complete();
      })
      .catch(observer.error.bind(observer));
  });
}
github caioreis123 / market2 / backend2 / node_modules / apollo-link / lib / bundle.esm.js View on Github external
function fromError(errorValue) {
    return new Observable(function (observer) {
        observer.error(errorValue);
    });
}
function transformOperation(operation) {
github apollographql / apollo-link / packages / apollo-link / src / linkUtils.ts View on Github external
export function fromError(errorValue: any): Observable {
  return new Observable(observer => {
    observer.error(errorValue);
  });
}
github caioreis123 / market2 / backend2 / node_modules / apollo-link / lib / bundle.esm.js View on Github external
function fromPromise(promise) {
    return new Observable(function (observer) {
        promise
            .then(function (value) {
            observer.next(value);
            observer.complete();
        })
            .catch(observer.error.bind(observer));
    });
}
function fromError(errorValue) {

zen-observable-ts

Thin wrapper around zen-observable and @types/zen-observable, to support ESM exports as well as CommonJS exports

MIT
Latest version published 3 years ago

Package Health Score

71 / 100
Full package analysis

Popular zen-observable-ts functions

Similar packages