Skip to content

Commit

Permalink
Chore: rxjs 실험용 디렉토리 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
InSeong-So committed Feb 9, 2023
1 parent 461b82e commit 47828cb
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 0 deletions.
44 changes: 44 additions & 0 deletions src/use-rxjs/package-lock.json

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

15 changes: 15 additions & 0 deletions src/use-rxjs/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "use-rxjs",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"rxjs": "^7.8.0"
}
}
21 changes: 21 additions & 0 deletions src/use-rxjs/src/code.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const rxjs = require('rxjs');
const { of } = require('rxjs'); // 생성함수
const { map } = require('rxjs/operators'); // 연산함수

const x = rxjs.of(1, 2, 3);

x.subscribe(data => {
console.log(data);
});
// 1
// 2
// 3

const y = of(1, 2, 3).pipe(map(x => x * 10));

y.subscribe(data => {
console.log(data);
});
// 10
// 20
// 30

0 comments on commit 47828cb

Please sign in to comment.