From 8b2db6c1fdc9415d7ef2de62ed47dbfe7ef427fa Mon Sep 17 00:00:00 2001 From: Brian Ball Date: Sun, 28 Apr 2024 05:31:38 -0700 Subject: [PATCH 1/2] Update family.mdx English improvements for clarity. --- docs/utilities/family.mdx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/utilities/family.mdx b/docs/utilities/family.mdx index 45cd1016b7..7f92bdf017 100644 --- a/docs/utilities/family.mdx +++ b/docs/utilities/family.mdx @@ -15,12 +15,12 @@ atomFamily(initializeAtom, areEqual): (param) => Atom ``` This will create a function that takes `param` and returns an atom. -If it's already created, it will return it from the cache. -`initializeAtom` is function that can return any kind of atom (`atom()`, `atomWithDefault()`, ...). -Note that `areEqual` is optional, which tell +If the atom has already been created, it will be returned from the cache. +`initializeAtom` is a function that can return any kind of atom (`atom()`, `atomWithDefault()`, ...). +Note that the `areEqual` argument is optional and compares if two params are equal (defaults to `Object.is`). -To reproduce the similar behavior to [Recoil's atomFamily/selectorFamily](https://recoiljs.org/docs/api-reference/utils/atomFamily), +To reproduce behavior similar to [Recoil's atomFamily/selectorFamily](https://recoiljs.org/docs/api-reference/utils/atomFamily), specify a deepEqual function to `areEqual`. For example: ```js From 0f8274197ec71dd4e7dc1ded660d565f0c8de8f2 Mon Sep 17 00:00:00 2001 From: Brian Ball Date: Tue, 11 Jun 2024 21:55:14 -0700 Subject: [PATCH 2/2] Update concepts.mdx Typos and derivated to derived. reference: https://word.tips/spelling/derived-vs-derivated/ --- docs/basics/concepts.mdx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/basics/concepts.mdx b/docs/basics/concepts.mdx index a21ed12fcd..f0bc1a977b 100644 --- a/docs/basics/concepts.mdx +++ b/docs/basics/concepts.mdx @@ -14,10 +14,10 @@ The React world is very much like our world, it's a big set of small entities, w Now, the Jotai world also has its small entities, atoms, and they also have their state. Composing atoms will create your app state! Jotai considers anything to be an atom, so you may say: `Huh, I need objects and arrays, filter them and then sort them out`. -And here's the beauty of it, Jotai gracefully lets you create dumb atoms derivated from even more dumb atoms. +And here's the beauty of it, Jotai gracefully lets you create dumb atoms derived from even more dumb atoms. If, for example, I have a page with 2 tabs: online friends and offline friends. -I will have 2 atoms simply derivating from a common, dumber source. +I will have 2 atoms simply derived from a common, dumber source. ```js const dumbAtom = atom([{ name: 'Friend 1', online: false }]) @@ -27,4 +27,4 @@ const offlineAtom = atom((get) => get(dumbAtom).filter((item) => !item.online)) And you could keep going on complexity forever. -Another incredible feature of Jotai is the built-in ability to suspend when using asynchronous atoms. This is a relatively new features that yet needs to get experimented more, but definitely the future of how we build React apps. [Check out the docs](https://react.dev/blog/2022/03/29/react-v18#new-suspense-features) for more info. +Another incredible feature of Jotai is the built-in ability to suspend when using asynchronous atoms. This is a relatively new feature that needs more experimentation, but is definitely the future of how we will build React apps. [Check out the docs](https://react.dev/blog/2022/03/29/react-v18#new-suspense-features) for more info.