How to use any-observable - 3 common examples

To help you get started, we’ve selected a few any-observable 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 ionic-team / stencil / scripts / np / index.js View on Github external
const exec = (cmd, args, opts) => {
	// Use `Observable` support if merged https://github.com/sindresorhus/execa/pull/26
	const cp = execa(cmd, args, opts);

	return Observable.merge(
		streamToObservable(cp.stdout.pipe(split()), {await: cp}),
		streamToObservable(cp.stderr.pipe(split()), {await: cp})
	).filter(Boolean);
};
github jamesfer / cypher-query-builder / src / connection.ts View on Github external
stream(query: Query): Observable> {
    return new Observable((subscriber: Observer>): void => {
      if (!this.open) {
        subscriber.error(new Error('Cannot run query; connection is not open.'));
        return;
      }

      if (query.getClauses().length === 0) {
        subscriber.error(Error('Cannot run query: no clauses attached to the query.'));
        return;
      }

      const session = this.session();
      if (!session) {
        throw Error('Cannot run query: connection is not open.');
      }

      // Run the query
github jamesfer / cypher-query-builder / src / query.ts View on Github external
stream(): RxObservable> {
    if (!this.connection) {
      return new Observable((subscriber: Observer>): void => {
        subscriber.error(new Error('Cannot run query; no connection object available.'));
      });
    }

    return this.connection.stream(this);
  }

any-observable

Support any Observable library and polyfill

MIT
Latest version published 4 years ago

Package Health Score

70 / 100
Full package analysis

Popular any-observable functions