Closed krawaller closed 3 years ago
Hmm I was thinking about this before, but there's a footgun with doing this:
The sliced array stays static, even if items are added or removed.
So the "obvious" solution would be to create some kind of Atom
which contains this list, which is updated as soon as the input-atom (Atom<Array<Element>>
) is changed.
I tried doing that this morning but I get infinite updates problem in react, going to investigate
I agree that sliceAtomArray
is low-level, and would benefit from further wrappers.
But those wrappers can be React-specific, or Svelte-specific, or just framework agnostic like sliceAtomArray
itself. It still isn't tied to React?
The
sliceAtomArray
helper isn't React specific, so shouldn't hide insidereact-utils