Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

simply-observable

processeus5ISC1.0.1

This is a really simplified version of the RXJS observable class. It does not do anything more than notifying the subscribed functions when an event occurs somewhere.

API

Importing `typescript import {SimpleObservable} from "simply-observable"

readme

Simply Observable

This is a really simplified version of the RXJS observable class. It does not do anything more than notifying the subscribed functions when an event occurs somewhere.

API

Importing

import {SimpleObservable} from "simply-observable";

Constructor

let myObservable = new SimpleObservable<T>();

Subscribing to the observable

myObservable.subscribe((payload: T) => {
  console.log(payload);
});

Unsubscribing

myObservable.unsubscribe(subscriberFunction);

Notifying the subscribed functions with a payload value

myObservable.next("Hello world!");