Created
October 26, 2018 10:24
-
-
Save kievsash/70d49a54e685bdda2d737134a368efbb to your computer and use it in GitHub Desktop.
rx.js, 'of' argument scheduler
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let Rx = window['rxjs']; | |
const {of, | |
queueScheduler, | |
asapScheduler, | |
asyncScheduler, | |
animationFrameScheduler | |
} = Rx; | |
const {observeOn, tap} = Rx.operators; | |
console.clear(); | |
setTimeout(() => console.log('It will runs just after this Macrotask')) | |
let source$ = of(1, 2, 3, asyncScheduler).pipe( | |
tap((v) => console.log('tap ', v)) | |
) | |
source$.subscribe((v) => { | |
console.log('Value ', v); | |
Promise.resolve().then(() => console.log('Microtask value ', v)); | |
setTimeout(() => console.log('MAcrotask value ', v), 0); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment