wait-for-observables
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

wait-for-observables

npm Build Status

A helper for awaiting the results of one or more Observables.

This is particularly handy when testing interfaces that return or consume observables.

Usage

import waitFor from 'wait-for-observables';
 
describe(`observable things`, () => {
 
  it(`observes`, async () => {
    const [result1, result2] = await waitFor(observable1, observable2);
    // …do things with the results.
  });
 
});

An observer that completes successfully will yield { values: any[] }, where values is an array containing an entry for each call to next.

Observers that fail will yield { error: any }.

Readme

Keywords

Package Sidebar

Install

npm i wait-for-observables

Weekly Downloads

7,217

Version

1.0.3

License

Apache-2.0

Last publish

Collaborators

  • convoy_artifactory
  • convoy_ci
  • convoy_admin
  • donvoy