Skip to content

Instantly share code, notes, and snippets.

@jefBinomed
Last active December 17, 2020 16:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jefBinomed/ddafcbb1932c865690c792b3fd3f5286 to your computer and use it in GitHub Desktop.
Save jefBinomed/ddafcbb1932c865690c792b3fd3f5286 to your computer and use it in GitHub Desktop.
RxJS in Devtools (Source Panel -> Snippet Tab -> Create a new Snippet)
(async ()=>{
let libUrl = 'https://unpkg.com/@reactivex/rxjs@6.3.3/dist/esm2015/index.js';
// Change with your version
let opUrl = 'https://unpkg.com/@reactivex/rxjs@6.3.3/dist/esm2015/operators/index.js';
// Change with your version
const Rx = await import(libUrl);
const Op = await import(opUrl);
/**
* Write your RxJS code below, here a simple example
*/
const source$ = Rx.of(1, 2, 3, 4, 5);
//output: 1,2,3,4,5
const subscription = source$.pipe(
Op.map(data => data*2),
Op.filter(x => x <10))
.subscribe(val => console.log(val));
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment