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
1
npm i @hullo/core
Copied!
...then in your code:
1
import
{
Observable
,
map
}
from
'@hullo/core'
2
β
3
new
Observable
(
observer
=>
{
4
observer
.
next
(
1
)
5
.
then
(()
=>
observer
.
next
(
2
))
6
.
then
(()
=>
observer
.
next
(
3
));
7
.
then
(()
=>
observer
.
complete
());
8
}).
pipe
(
map
(
n
=>
n
*
2
)).
subscribe
({
9
next
:
v
=>
{
console
.
log
(
v
)
}
10
});
11
β
12
// logs out 2,4 and 6
Copied!
β
Previous
Hullo π
Next
What is an Observable?
Last modified
3yr ago
Copy link
Contents
Install