Skip to content

Commit

Permalink
Adds first example for RxJS (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
olange committed Feb 11, 2019
1 parent 6547043 commit d8546b3
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 0 deletions.
16 changes: 16 additions & 0 deletions experiments/01-rxjs-intro/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const { Observable } = require( "rxjs");

const foo = new Observable(subscriber => {
console.log('Hello');
subscriber.next(42);
subscriber.next(43);
setTimeout( () => { subscriber.next(45) }, 1000);
});

foo.subscribe(x => {
console.log(x);
});

foo.subscribe(y => {
console.log(y);
});
21 changes: 21 additions & 0 deletions experiments/01-rxjs-intro/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions experiments/01-rxjs-intro/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "01-rxjs-intro",
"version": "1.0.0",
"description": "First steps with RxJS",
"main": "index.js",
"scripts": {
"start": "node index.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "https://github.com/olange/learning-streams/experiments/01-rxjs-intro"
},
"keywords": [
"streams",
"observable",
"rxjs",
"experiment"
],
"author": "Olivier Lange",
"license": "BSD-3-Clause",
"dependencies": {
"rxjs": "^6.4.0"
}
}

0 comments on commit d8546b3

Please sign in to comment.