Skip to content

Instantly share code, notes, and snippets.

@sergzak022
Created January 18, 2018 21:41
Show Gist options
  • Save sergzak022/9910e5bd97d07a00b1d991f0c0dcf91a to your computer and use it in GitHub Desktop.
Save sergzak022/9910e5bd97d07a00b1d991f0c0dcf91a to your computer and use it in GitHub Desktop.
RxJS: Switching and Exhausting
var switched$ = source$.map((number) => {
return multBy2Delayed(number);
}).switch();
// Code above will work exactly the same as code bellow
var switched$ = source$.switchMap((number) => {
return multBy2Delayed(number);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment