We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 09ff947 commit 56de972Copy full SHA for 56de972
docs/study-recoil.mdx
@@ -1,6 +1,7 @@
1
---
2
title: Recoil について勉強した
3
created: 1589622364679
4
+tags: [react]
5
6
7
Fecebook が新しく発表した [Recoil](https://recoiljs.org/) について
@@ -64,7 +65,9 @@ DefinitelyTyped に PR が出てるが、まだマージされてない。
64
65
66
また、 selector への set で atom を非同期に書き換えるというインターフェースになっている。単方向サブスクリプションではなく、双方向。
67
-## selector が immutable とはどういうことか。
68
+## selector が mutable
69
+
70
+atom と selector も、 `const [state, setState] = useRecoilState(atom_or_selector)` できる。 selector が setState できる、とはどううことだろうか。
71
72
単一な状態を持つ atom だけではなく、グラフ中で selector ノードも、まるで Mutable かのような API を持つ。自分自身への更新時、非同期に個別の atom への set を再発行できるファサードになっている。
73
0 commit comments