simply-observable
v1.0.1
Published
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"
Downloads
2
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!");