🚀[FEATURE]: Iterate operator #1920
Unanswered
BenRacicot
asked this question in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Relevant Package
This feature request is for @ngxs/store/operators
Description
Iterating on store data arrays does not have a dedicated operator.
updateItem
.Describe the problem you are trying to solve
Various engineers have stated that there exists no NGXS operator to iterate an array.
This causes pain when updating nested data like the
tasks
arrays in the image above. I've had to write native JS for recursion and to update nested items.Describe the solution you'd like
An
iterate
operator that allows us to run operators on each index of the data store.This way we could execute an
iif
and subsequent operators (possible recursion) on each index.Describe alternatives you've considered
Currently using native JS to update nested items.
Tried many variations of operators to make this happen and spoke to several members of the community.
Here is a Stackblitz with the problem all set up so solve (see
@Action(UpdateTask)
)Beta Was this translation helpful? Give feedback.
All reactions