You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! I'm working on a project that's using elf/elf-entities, and a colleague is using it to track changesets for a paginated entities store. I wanted to get some advice on the most common approaches to handling that.
Back when I used Redux, the way I might handle those is to have a state with 3 simple collections for what changed (added/removed/updated, arrays/sets/maps depending on how complex the keys are). Then, since everything's routed through actions/reducers, I can just update these collections manually. I imagine I could do the same thing in Elf with withProps() and a repository pattern, since the functions on the repository can control what goes into the store.
My colleague is recommending an approach that takes a snapshot of the full list of entities, then does an array comparison of the two to infer what has been added/removed/updated as changes are made. They've also strongly recommended that I not look at Elf as an analog for Redux, which has made me quite unsure about myself and how I use this library.
I wanted to ask if the Elf community has any thoughts on this, and how I might better align my own understanding of state management with the Elf library. Thanks!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi! I'm working on a project that's using elf/elf-entities, and a colleague is using it to track changesets for a paginated entities store. I wanted to get some advice on the most common approaches to handling that.
Back when I used Redux, the way I might handle those is to have a state with 3 simple collections for what changed (added/removed/updated, arrays/sets/maps depending on how complex the keys are). Then, since everything's routed through actions/reducers, I can just update these collections manually. I imagine I could do the same thing in Elf with
withProps()
and a repository pattern, since the functions on the repository can control what goes into the store.My colleague is recommending an approach that takes a snapshot of the full list of entities, then does an array comparison of the two to infer what has been added/removed/updated as changes are made. They've also strongly recommended that I not look at Elf as an analog for Redux, which has made me quite unsure about myself and how I use this library.
I wanted to ask if the Elf community has any thoughts on this, and how I might better align my own understanding of state management with the Elf library. Thanks!
Beta Was this translation helpful? Give feedback.
All reactions