Hullo JS
Github
Chat
Searchβ¦
Hullo JS
Hullo π
Hullo π core
Intro to Core
What is an Observable?
RxJS familiarities and differences
API
Hullo π browser
Intro to Browser
API
Hullo π DOM
Intro to DOM
Guide
API
Hullo π Node
Intro to Node
API
Powered By
GitBook
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)
What is an Observable?
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
β
Previous
Hullo π
Next
What is an Observable?
Last modified
3yr ago
Copy link