ååã®èšäºã§ã¯ãã¹ããªãŒã ãšã¯äœãããããŠããããäœãé£ã¹ãã®ããèŠãŸããã æ°ããããŒãã§ã¯ãRxJSããããŒãäœæããããã«æäŸããã¡ãœããããªãã¬ãŒã¿ãŒããã€ããšã¯äœãããããŠããããæäœããæ¹æ³ã«ã€ããŠåŠã³ãŸãã
RxJSã«ã¯è±å¯ãªAPIããããŸã ã ããã¥ã¡ã³ãã«ã¯ã100ãè¶ ããã¡ãœããã説æãããŠããŸãã ãããã«ã€ããŠå°ãç¥ãããã«ãåçŽãªã¢ããªã±ãŒã·ã§ã³ãäœæããå®éã«ã¯ãªã¢ã¯ãã£ãã³ãŒããã©ã®ããã«èŠãããã確èªããŸãã åå¿æ§ã®ããªãºã ãéããŠããããèŠããšããã€ãŠã¯æ¥åžžçã§å€ãã®ã³ãŒããæžãå¿ èŠããã£ãåãã¿ã¹ã¯ããšã¬ã¬ã³ããªãœãªã¥ãŒã·ã§ã³ãæã£ãŠããããšãããããŸãã ããããå®è·µãå§ããåã«ããããŒãã°ã©ãã£ã«ã«ã«è¡šçŸããæ¹æ³ãèŠãŠããããŒãäœæããŠåŠçãã䟿å©ãªæ¹æ³ãç解ããŸãã
ã¹ã¬ããã®ã°ã©ãã£ã«ã«ãªè¡šçŸ
ç¹å®ã®ãããŒãã©ã®ããã«åäœããããæ確ã«ç€ºãããã«ããªã¢ã¯ãã£ãã¢ãããŒãã§æ¡çšãããŠããè¡šèšæ³ã䜿çšããŸãã åã®èšäºã®äŸãæãåºããŠãã ããã
const observable = new Observable((observer) => { observer.next(1); observer.next(2); observer.complete(); });
ãã®ã°ã©ãã£ã«ã«è¡šçŸã¯æ¬¡ã®ããã«ãªããŸãã
éåžžããããŒã¯çŽç·ã§è¡šãããŸãã ã¹ããªãŒã ãå€ãåºåããå Žåãç·ãšããŠåãšããŠè¡šç€ºãããŸãã ãã£ã¹ãã¬ã€å ã®çŽç·ã¯ãã¹ããªãŒã ãçµäºããä¿¡å·ã§ãã ãšã©ãŒã衚瀺ããã«ã¯ãèšå·ã-ãã䜿çšããŸãã
const observable = new Observable((observer) => { observer.error(); });
ã¯ã³ã©ã€ã³ã¹ããªãŒã
ç§ã®ç·Žç¿ã§ã¯ãèªåã®Observableã€ã³ã¹ã¿ã³ã¹ãçŽæ¥äœæããå¿ èŠã¯ã»ãšãã©ãããŸããã§ããã ã¹ã¬ãããäœæããã»ãšãã©ã®ã¡ãœããã¯ããã§ã«RxJSã«ãããŸãã å€1ããã³2ãæŸåºããã¹ããªãŒã ãäœæããã«ã¯ãofã¡ãœããã䜿çšããŸãã
const observable = of(1, 2);
ofã¡ãœããã¯ä»»æã®æ°ã®åŒæ°ãåãå ¥ããObservableã®æ¢è£œã®ã€ã³ã¹ã¿ã³ã¹ãè¿ããŸãã 賌èªåŸãåä¿¡ããå€ãçºè¡ããŠå®äºããŸãïŒ
é åãã¹ããªãŒã ãšããŠè¡šçŸããå Žåã¯ãfromã¡ãœããã䜿çšã§ããŸãã åŒæ°ãšããŠã®fromã¡ãœããã¯ãå埩å¯èœãªãªããžã§ã¯ãïŒé åãæååãªã©ïŒãŸãã¯ãããã¹ãæ³å®ãããã®ãªããžã§ã¯ããã¹ããªãŒã ã«æ圱ããŸãã æååããååŸããã¹ããªãŒã ã¯æ¬¡ã®ããã«ãªããŸãã
const observable = from('abc');
ãããŠãããªãã¯ã¹ããªãŒã ã§çŽæãå ãããšãã§ããŸãïŒ
const promise = new Promise((resolve, reject) => { resolve(1); }); const observable = from(promise);
泚ïŒå€ãã®å Žåãã¹ã¬ããã¯promiseãšæ¯èŒãããŸãã å®éãå ±éç¹ã¯1ã€ã ãã§ããå€åãåºããããã®ããã·ã¥æŠç¥ã§ã ã æ®ãã¯å®å šã«ç°ãªããšã³ãã£ãã£ã§ãã Promiseã¯è€æ°ã®å€ãçæã§ããŸããã 解決ãŸãã¯æåŠã®ã¿ãå®è¡ã§ããŸãã 2ã€ã®ç¶æ ã®ã¿ããããŸãã ã¹ããªãŒã ã¯è€æ°ã®å€ãéä¿¡ã§ããåå©çšã§ããŸãã
æåã®èšäºããã®ééã®äŸãèŠããŠããŸããïŒ ãã®ã¹ããªãŒã ã¯ããµãã¹ã¯ãªãã·ã§ã³ã®ç¬éããç§åäœã§æéãã«ãŠã³ãããã¿ã€ããŒã§ãã
const timer = new Observable(observer => { let counter = 0; const intervalId = setInterval(() => { observer.next(counter++); }, 1000); return () => { clearInterval(intervalId); } });
åãããšã1è¡ã§å®è£ ããæ¹æ³ã¯æ¬¡ã®ãšããã§ãã
const timer = interval(1000);
ãããŠæåŸã«ãDOMèŠçŽ ã®ã€ãã³ãã®ã¹ããªãŒã ãäœæã§ããã¡ãœããïŒ
const observable = fromEvent(domElementRef, 'keyup');
å€ãšããŠããã®ã¹ããªãŒã ã¯ããŒã¢ããã€ãã³ããªããžã§ã¯ããéåä¿¡ããŸãã
ãã€ããšãªãã¬ãŒã¿ãŒ
Pipeã¯ãRxJSããŒãžã§ã³5.5ã§è¿œå ãããObservableã¯ã©ã¹ã¡ãœããã§ãã ãã®ãããã§ãã¹ããªãŒã ã§åä¿¡ããå€ãé 次åŠçããããã®æŒç®åã®ãã§ãŒã³ãæ§ç¯ã§ããŸãã ãã€ãã¯ããªãã¬ãŒã¿ãŒãçžäºæ¥ç¶ããåæ¹åãã£ãã«ã§ãã æŒç®åèªäœã¯ãã¹ããªãŒã ããã®å€ãåŠçããRxJSã§èšè¿°ãããŠããéåžžã®é¢æ°ã§ãã
ããšãã°ãå€ãå€æããŠã¹ããªãŒã ã«ããã«æž¡ãããšãã§ããŸãããŸãããã£ã«ã¿ãŒãšããŠæ©èœããæå®ãããæ¡ä»¶ãæºãããŠããªãå Žåã¯å€ãã¹ãããããŸããã
åäœäžã®æŒç®åãèŠãŠã¿ãŸãããã ãããæŒç®åã䜿çšããŠãã¹ããªãŒã ã®åå€ã«2ãæããŸãã
of(1,2,3).pipe( map(value => value * 2) ).subscribe({ next: console.log });
ãããæŒç®åãé©çšããåã®ã¹ããªãŒã ã¯æ¬¡ã®ãšããã§ãã
mapã¹ããŒãã¡ã³ãã®åŸïŒ
ãã£ã«ã¿ãŒæŒç®åã䜿çšããŠã¿ãŸãããã ãã®ã¹ããŒãã¡ã³ãã¯ãArrayã¯ã©ã¹ã®ãã£ã«ã¿ãŒé¢æ°ãšåãããã«æ©èœããŸãã ãã®ã¡ãœããã¯ãæ¡ä»¶ãèšè¿°ããé¢æ°ãæåã®åŒæ°ãšããŠåãåããŸãã ã¹ããªãŒã ã®å€ãæ¡ä»¶ãæºãããŠããå Žåã次ã®ããã«æž¡ãããŸãã
of(1, 2, 3).pipe( // filter(value => value % 2 !== 0), map(value = value * 2) ).subscribe({ next: console.log });
ãããŠãããã¯ç§ãã¡ã®ã¹ããªãŒã ã®ã¹ããŒã å šäœãã©ã®ããã«èŠãããã§ãïŒ
ãã£ã«ã¿ãŒåŸïŒ
ãããåŸïŒ
æ³šïŒ pipeïŒ==ãµãã¹ã¯ã©ã€ãã pipeã¡ãœããã¯ãããŒã®åäœã宣èšããŸããããµãã¹ã¯ã©ã€ãããŸããã subscribeã¡ãœãããåŒã³åºããŸã§ãã¹ããªãŒã ã¯æ©èœãå§ããŸããã
ã¢ããªã±ãŒã·ã§ã³ãæžã
ãã€ããšæŒç®åãäœã§ããããããã£ãã®ã§ãç·Žç¿ãéå§ã§ããŸãã ã¢ããªã±ãŒã·ã§ã³ã¯ã1ã€ã®ç°¡åãªã¿ã¹ã¯ãå®è¡ããŸããå ¥åãããææè ã®ããã¯ããŒã å¥ã«ãéããŠããgithubãªããžããªã®ãªã¹ãã衚瀺ããŸãã
ããã€ãã®èŠä»¶ããããŸãã
- å ¥åã«å ¥åãããæååã«å«ãŸããæåã3æåæªæºã®å ŽåãAPIèŠæ±ãå®è¡ããªãã§ãã ããã
- ãŠãŒã¶ãŒãå ¥åããåæåã®èŠæ±ãæºãããªãããã«ããã«ã¯ãAPIã«ã¢ã¯ã»ã¹ããåã«700ããªç§ã®é 延ïŒãããŠã³ã¹ïŒãèšå®ããå¿ èŠããããŸãã
ãªããžããªãæ€çŽ¢ããã«ã¯ã github APIã䜿çšããŸã ã stackblitzã§ãµã³ãã«ãå®è¡ããããšããå§ãããŸã ã ããã§ãå®æããå®è£ ãã¬ã€ã¢ãŠãããŸããã ãªã³ã¯ã¯èšäºã®æåŸã«ãããŸãã
htmlããŒã¯ã¢ããããå§ããŸãããã inputèŠçŽ ãšulèŠçŽ ã«ã€ããŠèª¬æããŸãããã
<input type="text"> <ul></ul>
次ã«ãjsãŸãã¯tsãã¡ã€ã«ã§ããã©ãŠã¶ãŒAPIã䜿çšããŠçŸåšã®èŠçŽ ãžã®ãªã³ã¯ãååŸããŸãã
const input = document.querySelector('input'); const ul = document.querySelector('ul');
ãŸããgithub APIãžã®ãªã¯ãšã¹ããå®è¡ããã¡ãœãããå¿ èŠã§ãã 以äžã¯getUsersRepsFromAPIé¢æ°ã®ã³ãŒãã§ãããã®é¢æ°ã¯ãŠãŒã¶ãŒã®ããã¯ããŒã ãåãå ¥ãããã§ããã䜿çšããŠajaxãªã¯ãšã¹ããå®è¡ããŸãã 次ã«ãçŽæãè¿ããæåããå¿çãéäžã§jsonã«å€æããŸãã
const getUsersRepsFromAPI = (username) => { const url = `https://api.github.com/users/${ username }/repos`; return fetch(url) .then(response => { if(response.ok) { return response.json(); } throw new Error(''); }); }
次ã«ããªããžããªã®ååããªã¹ãããã¡ãœãããäœæããŸãã
const recordRepsToList = (reps) => { for (let i = 0; i < reps.length; i++) { // , if (!ul.children[i]) { const newEl = document.createElement('li'); ul.appendChild(newEl); } // const li = ul.children[i]; li.innerHTML = reps[i].name; } // while (ul.children.length > reps.length) { ul.removeChild(ul.lastChild); } }
æºåãå®äºããŸããã RxJSã®å®éã®åäœãèŠãŠã¿ãŸãããã å ¥åã®ããŒã¢ããã€ãã³ãããªãã¹ã³ããå¿ èŠããããŸãã ãŸãããªã¢ã¯ãã£ãã¢ãããŒãã§ã¯ãããŒãæäœããããšãç解ããå¿ èŠããããŸãã 幞ããªããšã«ãRxJSã¯ãã§ã«åæ§ã®ãªãã·ã§ã³ãæäŸããŠããŸãã åè¿°ã®fromEventã¡ãœãããæãåºããŠãã ããã ç§ãã¡ã¯ããã䜿çšããŸãïŒ
const keyUp = fromEvent(input, 'keyup'); keyUp.subscribe({ next: console.log });
ããã§ãã€ãã³ããã¹ããªãŒã ãšããŠè¡šç€ºãããŸãã ã³ã³ãœãŒã«ã«è¡šç€ºããããã®ãèŠããšãKeyboardEventã¿ã€ãã®ãªããžã§ã¯ãã衚瀺ãããŸãã ãã ãããŠãŒã¶ãŒãå ¥åããå€ãå¿ èŠã§ãã ããã¯ããã€ãã¡ãœãããšãããæŒç®åã圹ç«ã€å Žæã§ãã
fromEvent(input, 'keyup').pipe( map(event => event.target.value) ).subscribe({ next: console.log });
èŠä»¶ã®å®è£ ã«é²ã¿ãŸãã ãŸããå ¥åããå€ã«3æå以äžãå«ãŸããŠããå Žåã«ã¯ãšãªãå®è¡ããŸãã ãããè¡ãã«ã¯ããã£ã«ã¿ãŒæŒç®åã䜿çšããŸãã
fromEvent(input, 'keyup').pipe( map(event => event.target.value), filter(value => value.length > 2) )
æåã®èŠä»¶ãæŽçãããŸããã 2çªç®ã«é²ã¿ãŸãã ãããŠã³ã¹ãå®è£ ããå¿ èŠããããŸãã RxJSã«ã¯debounceTimeã¹ããŒãã¡ã³ãããããŸãã æåã®åŒæ°ãšããŠã®ãã®æŒç®åã¯ãå€ãä¿æãããéãæž¡ãåã«ããªç§æ°ããšããŸãã ãã®å Žåãæ°ããå€ããšã«ã¿ã€ããŒããªã»ãããããŸãã ãããã£ãŠãåºåã§ã¯ã700ããªç§ãçµéããåŸãæåŸã®å€ãååŸããŸãã
fromEvent(input, 'keyup').pipe( debounceTime(700), map(event => event.target.value), filter(value => value.length > 2) )
debounceTimeã䜿çšããªãå Žåãã¹ããªãŒã ã¯æ¬¡ã®ããã«ãªããŸãã
ãããŠãããã¯ããã®ã¹ããŒãã¡ã³ããééããåãã¹ããªãŒã ãã©ã®ããã«èŠãããã§ãïŒ
debounceTimeã䜿çšãããšãAPIã䜿çšããå¯èœæ§ãäœããªãããã©ãã£ãã¯ãç¯çŽããŠãµãŒããŒã®è² è·ã軜æžã§ããŸãã
è¿œå ã®æé©åã®ããã«ãå¥ã®æŒç®ådistinctUntilChangedã䜿çšããããšããå§ãããŸãã ãã®æ¹æ³ã«ãããéè€ãé²ãããšãã§ããŸãã äŸã§ãã®äœæ¥ã瀺ãã®ãæåã§ãïŒ
from('aaabccc').pipe( distinctUntilChanged() )
distinctUntilChangedãªãïŒ
distinctUntilChangedã®å ŽåïŒ
debounceTimeã¹ããŒãã¡ã³ãã®çŽåŸã«ãã®ã¹ããŒãã¡ã³ããè¿œå ããŸãã ãããã£ãŠãäœããã®çç±ã§æ°ããå€ãåã®å€ãšäžèŽããå ŽåãAPIã«ã¢ã¯ã»ã¹ããŸããã åæ§ã®ç¶æ³ã¯ããŠãŒã¶ãŒãæ°ããæåãå ¥åããŠããåã³æ¶å»ãããšãã«ãçºçããŸãã é 延ãå®è£ ããŠããã®ã§ãæåŸã®å€ã®ã¿ãã¹ããªãŒã ã«å«ãŸããŸããããã¯æ¢ã«æã£ãŠããçãã§ãã
ãµãŒããŒã«è¡ã
ããã§ããªã¯ãšã¹ããšã¬ã¹ãã³ã¹ã®åŠçã®ããžãã¯ã説æã§ããŸãã ç§ãã¡ã¯çŽæããã£ãŠã®ã¿åãããšãã§ããŸããã ãããã£ãŠãgetUsersRepsFromAPIã¡ãœãããåŒã³åºãå¥ã®ãããæŒç®åã«ã€ããŠèª¬æããŸãã ãªãã¶ãŒããŒã§ã¯ãçŽæã®åŠçããžãã¯ãèšè¿°ããŸãã
/* ! RxJS promise, */ fromEvent(input, 'keyup').pipe( debounceTime(700), map(event => event.target.value), filter(val => val.length > 2), distinctUntilChanged(), map(value => getUsersRepsFromAPI(value)) ).subscribe({ next: promise => promise.then(reps => recordRepsToList(reps)) });
çŸæç¹ã§ã¯ãå¿ èŠãªãã¹ãŠãå®è£ ããŠããŸãã ãããããã®äŸã«ã¯1ã€ã®å€§ããªæ¬ ç¹ããããŸãããšã©ãŒåŠçããããŸããã ç§ãã¡ã®ãªãã¶ãŒããŒã¯çŽæã ããåãåããäœããããŸããããªãå¯èœæ§ãããããšãç¥ããŸããã
ãã¡ããã次ã®ã¡ãœããã§promiseã«catchãæããããšãã§ããŸããããã®ãããã³ãŒãã¯ãŸããŸããã³ãŒã«ããã¯å°çãã®ããã«èŠãå§ããŸãã çªç¶ãã1ã€ã®ãªã¯ãšã¹ããå®è¡ããå¿ èŠãããå Žåãã³ãŒãã®è€éããå¢ããŸãã
æ³šïŒ RxJSã³ãŒãã§promiseã䜿çšããããšã¯ãã¢ã³ããã¿ãŒã³ãšèŠãªãããŸãã Promiseã«ã¯ã芳枬å¯èœãšæ¯èŒããŠå€ãã®æ¬ ç¹ããããŸãã å ã«æ»ãããšã¯ã§ãããåå©çšããããšãã§ããŸããã éžæè¢ãããå Žåã¯ãobservableãéžæããŸãã Observableã¯ã©ã¹ã®toPromiseã¡ãœããã«ã€ããŠãåãããšãèšããŸãã ãã®ã¡ãœããã¯ãã¹ããªãŒã ãåŠçã§ããªãã©ã€ãã©ãªãšã®äºææ§ã®ããã«å®è£ ãããŸããã
fromã¡ãœããã䜿çšããŠãããã¹ãã¹ããªãŒã ã«æ圱ã§ããŸããããã®ã¡ãœããã«ã¯subscribeã¡ãœãããžã®è¿œå ã®åŒã³åºããå«ãŸããŠãããã³ãŒãã®æé·ãšè€éãã«ãã€ãªãããŸãã
ãã®åé¡ã¯ãmergeMapæŒç®åã䜿çšããŠè§£æ±ºã§ããŸãã
fromEvent(input, 'keyup').pipe( debounceTime(700), map(event => event.target.value), filter(val => val.length > 2), distinctUntilChanged(), mergeMap(value => from(getUsersRepsFromAPI(value))) ).subscribe({ next: reps => recordRepsToList(reps), error: console.log })
ããã§ãPromiseåŠçããžãã¯ãèšè¿°ããå¿ èŠã¯ãããŸããã fromã¡ãœããã¯promiseã¹ããªãŒã ãäœæããmergeMapãªãã¬ãŒã¿ãŒããããåŠçããŸããã çŽæãæ£åžžã«å±¥è¡ããããšã次ã®ã¡ãœãããåŒã³åºããããªãã¶ãŒããŒã¯å®æãããªããžã§ã¯ããåãåããŸãã ãšã©ãŒãçºçããå Žåããšã©ãŒã¡ãœãããåŒã³åºããããªãã¶ãŒããŒã¯ã³ã³ãœãŒã«ã«ãšã©ãŒãåºåããŸãã
mergeMapæŒç®åã¯ã以åã«äœ¿çšããæŒç®åãšã¯å°ãç°ãªãã次ã®èšäºã§èª¬æããããããHigher Order Observablesã«å±ããŸãã ããããå ãèŠãŠãç§ã¯mergeMapã¡ãœããèªäœãã¹ããªãŒã ããµãã¹ã¯ã©ã€ããããšèšããŸãã
ãšã©ãŒåŠç
ã¹ã¬ããããšã©ãŒãåä¿¡ããå Žåãã¹ã¬ããã¯çµäºããŸãã ãŸãããšã©ãŒã®åŸã«ã¢ããªã±ãŒã·ã§ã³ãšå¯Ÿè©±ããããšããŠããã¹ããªãŒã ãå®äºããŠãããããåå¿ã¯ãããŸããã
ããã§ãcatchErroræŒç®åã圹ç«ã¡ãŸãã catchErrorã¯ãã¹ããªãŒã ã§ãšã©ãŒãçºçããå Žåã«ã®ã¿çºçããŸãã ã€ã³ã¿ãŒã»ããããŠåŠçããéåžžã®å€ãã¹ããªãŒã ã«æ»ãããšãã§ããŸãããå®äºã«ã¯è³ããŸããã
fromEvent(input, 'keyup').pipe( debounceTime(700), map(event => event.target.value), filter(val => val.length > 2), distinctUntilChanged(), mergeMap(value => from(getUsersRepsFromAPI(value))), catchError(err => of([]) ).subscribe({ next: reps => recordRepsToList(reps), error: console.log })
catchErrorã§ãšã©ãŒããã£ãããã代ããã«ç©ºã®é åãæã€ã¹ããªãŒã ãè¿ããŸãã ããã§ããšã©ãŒãçºçããå Žåããªããžããªã®ãªã¹ããã¯ãªã¢ããŸãã ãããããã®åŸããããŒã¯åã³çµäºããŸãã
åé¡ã¯ãcatchErrorãå ã®ã¹ããªãŒã ãæ°ããã¹ããªãŒã ã«çœ®ãæããããšã§ãã ãããŠãç§ãã¡ã®ãªãã¶ãŒããŒã¯åœŒã ãã«è³ãåŸããŸãã ofã¹ããªãŒã ã空ã®é åãçºè¡ãããšãcompleteã¡ãœãããåŒã³åºãããŸãã
å ã®ã¹ã¬ããã眮ãæããªãããã«ãmergeMapæŒç®åå ããfromã¹ã¬ããã§catchErroræŒç®åãåŒã³åºããŸãã
fromEvent(input, 'keyup').pipe( debounceTime(700), map(event => event.target.value), filter(val => val.length > 2), distinctUntilChanged(), mergeMap(value => { return from(getUsersRepsFromAPI(value)).pipe( catchError(err => of([]) ) }) ).subscribe({ next: reps => recordRepsToList(reps), error: console.log })
ãããã£ãŠãå ã®ã¹ããªãŒã ã¯äœã«ãæ°ä»ããŸããã ãšã©ãŒã®ä»£ããã«ã空ã®é åãååŸããŸãã
ãããã«
ããããç·Žç¿ã«åãæããããã€ããšãªãã¬ãŒã¿ãŒã®ç®çã確èªããŸããã RxJSãæäŸãããªããAPIã䜿çšããŠã³ãŒããççž®ããæ¹æ³ãæ€èšããŸããã ãã¡ãããã¢ããªã±ãŒã·ã§ã³ã¯çµäºããŠããŸããã次ã®ããŒãã§ã¯ã1ã€ã®ã¹ã¬ããã§å¥ã®ã¹ã¬ãããåŠçããæ¹æ³ãšãã¢ããªã±ãŒã·ã§ã³ã®ãã©ãã£ãã¯ãšãªãœãŒã¹ãããã«ç¯çŽããããã«httpãªã¯ãšã¹ãããã£ã³ã»ã«ããæ¹æ³ãåæããŸãã ãããŠãã®éããèŠãããšãã§ããããã«ãRxJSã䜿çšããªãã§äŸãã¬ã€ã¢ãŠãããŸãã ã ããã§ãããèŠãããšãã§ããŸã ã ãã®ãªã³ã¯ã«ã¯ãçŸåšã®ã¢ããªã±ãŒã·ã§ã³ã®å®å šãªã³ãŒãããããŸãã åè·¯ãçæããããã«ã RxJSããžã¥ã¢ã©ã€ã¶ãŒã䜿çšããŸãã ã
ãã®èšäºããRxJSãã©ã®ããã«æ©èœããããããããç解ããã®ã«åœ¹ç«ã€ããšãé¡ã£ãŠããŸãã å匷ã«æåãããã§ãïŒ