Skip to content

Commit 56de972

Browse files
committed
Recoil
1 parent 09ff947 commit 56de972

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

docs/study-recoil.mdx

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
title: Recoil について勉強した
33
created: 1589622364679
4+
tags: [react]
45
---
56

67
Fecebook が新しく発表した [Recoil](https://recoiljs.org/) について
@@ -64,7 +65,9 @@ DefinitelyTyped に PR が出てるが、まだマージされてない。
6465

6566
また、 selector への set で atom を非同期に書き換えるというインターフェースになっている。単方向サブスクリプションではなく、双方向。
6667

67-
## selector が immutable とはどういうことか。
68+
## selector が mutable
69+
70+
atom と selector も、 `const [state, setState] = useRecoilState(atom_or_selector)` できる。 selector が setState できる、とはどううことだろうか。
6871

6972
単一な状態を持つ atom だけではなく、グラフ中で selector ノードも、まるで Mutable かのような API を持つ。自分自身への更新時、非同期に個別の atom への set を再発行できるファサードになっている。
7073

0 commit comments

Comments
 (0)