getMap
for AtomFamily
#2070
Unanswered
sowhatdoido
asked this question in
General
Replies: 1 comment
-
See also #2056 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Sorry if this has been asked before: I was looking for a way to iterate over an atom family.
I came upon a discussion where you said it isn't iterable by design, but in another place you mentioned that AtomFamily is supposed to be a simple helper function around map.
Is there a reason, philosophically, why you couldn't implement a
getMap
function that just returns the underlying map for people to iterate over?https://github.com/pmndrs/jotai/blob/main/src/vanilla/utils/atomFamily.ts
I figured that would be a straight forward way of exposing the underlaying data structure for people to manipulate directly, including iterate over, but I wasn't sure if that would mess something up with reactivity or something.
Beta Was this translation helpful? Give feedback.
All reactions