Options
All
  • Public
  • Public/Protected
  • All
Menu

Module @marcj/estdlib-rxjs

estdlib.ts RXJS

Build Status npm version

Installation

npm install @marcj/estdlib-rxjs

Usage example

import {Subscriptions} from "@marcj/estdlib-rxjs";

class MyComponent implements OnDestroy, OnInit {
    private subs = new Subscriptions;

    public onInit() {
        this.subs.add = this.observable.subscribe(() => {
            //do something
        });

        this.subs.add = this.anotherOne.subscribe(() => {
            //do something
        });
    }

    public OnDestroy() {
        this.subs.unsubscribe();
    }
}

Index

Functions

nextValue

  • nextValue<T>(o: Observable<T>): Promise<T>
  • Type parameters

    • T

    Parameters

    • o: Observable<T>

    Returns Promise<T>

observableToPromise

  • observableToPromise<T>(o: Observable<T>, next?: undefined | function): Promise<T>
  • Type parameters

    • T

    Parameters

    • o: Observable<T>
    • Optional next: undefined | function

    Returns Promise<T>

promiseToObservable

  • promiseToObservable<T>(o: function): Observable<T>
  • Type parameters

    • T

    Parameters

    • o: function
        • (): Promise<T>
        • Returns Promise<T>

    Returns Observable<T>

subscriptionToPromise

  • subscriptionToPromise<T>(subscription: Subscription): Promise<void>
  • Type parameters

    • T

    Parameters

    • subscription: Subscription

    Returns Promise<void>

tearDown

  • tearDown(teardown: TeardownLogic): Promise<void>
  • Parameters

    • teardown: TeardownLogic

    Returns Promise<void>

Generated using TypeDoc