fix(store): return original reference from updateItems when no elements match#2424
Conversation
…ts match updateItems always returned a new array clone, even when no element matched the predicate. This caused memoized selectors to see a changed reference and re-evaluate on every no-op call. Track whether any element was actually updated and return the original array reference unchanged when the predicate matched nothing.
|
| Command | Status | Duration | Result |
|---|---|---|---|
nx run-many --target=test --all --configuration... |
❌ Failed | 1m 20s | View ↗ |
nx run-many --target=lint --all --configuration... |
✅ Succeeded | 5s | View ↗ |
nx lint-types store |
✅ Succeeded | 3s | View ↗ |
nx run-many --target=build --all |
✅ Succeeded | 2s | View ↗ |
☁️ Nx Cloud last updated this comment at 2026-03-31 17:32:13 UTC
@ngxs/devtools-plugin
@ngxs/form-plugin
@ngxs/hmr-plugin
@ngxs/router-plugin
@ngxs/storage-plugin
@ngxs/store
@ngxs/websocket-plugin
commit: |
BundleMonFiles updated (1)
Unchanged files (5)
Total files change +217B +0.14% Groups updated (1)
Final result: ❌ View report in BundleMon website ➡️ |
BundleMon (NGXS Plugins)Unchanged files (9)
No change in files bundle size Unchanged groups (1)
Final result: ✅ View report in BundleMon website ➡️ |
BundleMon (Integration Projects)Unchanged files (1)
No change in files bundle size Final result: ✅ View report in BundleMon website ➡️ |
|
Hi! You might have a look at |

updateItems always returned a new array clone, even when no element matched the predicate. This caused memoized selectors to see a changed reference and re-evaluate on every no-op call.
Track whether any element was actually updated and return the original array reference unchanged when the predicate matched nothing.