Intro to Core

npm i @hullo/core

In this package you'll find two categories of things:

  • Observables (regular and specialised ones)

  • operators (functions that'll wrap the observable into an observable with additional mechanics)

Install

npm i @hullo/core

...then in your code:

import { Observable, map } from '@hullo/core'
new Observable(observer => {
observer.next(1)
.then(() => observer.next(2))
.then(() => observer.next(3));
.then(() => observer.complete());
}).pipe(map(n => n * 2)).subscribe({
next: v => { console.log(v) }
});
// logs out 2,4 and 6