https://medium.com/@pks2974/rxjs-%EA%B0%84%EB%8B%A8%EC%A0%95%EB%A6%AC-41f67c37e028
RxJS 간단정리
RxJS의 개념을 간단하게 정리한다.
medium.com
함수형 자바스크립트 프로그래밍 - pipe, go
data
velog.io
https://github.com/ReactiveX/rxjs
ReactiveX/rxjs
A reactive programming library for JavaScript. Contribute to ReactiveX/rxjs development by creating an account on GitHub.
github.com
** 수정모드 : CDN. https://unpkg.com/rxjs/bundles/rxjs.umd.min.js
const { range } = rxjs;
const { map, filter, tap } = rxjs.operators;
range(1, 200).pipe(
filter(x => x % 2 === 1),
map(x => x + x)
).subscribe(x => console.log(x));
range(1, 10).pipe(
tap(
(x) => console.log('tap:' + x),
(err) => console.error(err),
() => console.log('tap complete')
),
filter(x => !(x % 2)),
map(x => x + 1),
).subscribe(
(x) => console.log('subscribe:' + x),
(err) => console.err(err),
() => console.log('complete')
);
// tap:1
// tap:2
// subscribe:3
// tap:3
// tap:4
// subscribe:5
// tap:5
// tap:6
// subscribe:7
// tap:7
// tap:8
// subscribe:9
// tap:9
// tap:10
// subscribe:11
// tap complete
// complete
'Javascript' 카테고리의 다른 글
pinterest layout (waterfall) (0) | 2019.11.06 |
---|---|
Promise (0) | 2019.09.11 |
Vue.js (0) | 2019.08.01 |
코드스플리팅 (0) | 2019.07.30 |
Create-react-app (0) | 2019.07.29 |