Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Recoil
  • Loading branch information
mizchi committed May 16, 2020
1 parent 09ff947 commit 56de972
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion docs/study-recoil.mdx
@@ -1,6 +1,7 @@
---
title: Recoil について勉強した
created: 1589622364679
tags: [react]
---

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

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

## selector が immutable とはどういうことか。
## selector が mutable

atom と selector も、 `const [state, setState] = useRecoilState(atom_or_selector)` できる。 selector が setState できる、とはどううことだろうか。

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

Expand Down

0 comments on commit 56de972

Please sign in to comment.