angular-architects / ngrx-toolkit

Various Extensions for the NgRx Signal Store
MIT License
174 stars 23 forks source link

Multiple stores withDevtools not updating in Redux-DevTools #100

Open DanielPinkpank opened 3 weeks ago

DanielPinkpank commented 3 weeks ago

I have 2 working components using a signalStore. Both are initiated with "withDevtools". When I open the 1. component at first (after reload), the Redux-DevTool is showing the correct state. Also when I open the 2. component at first (after reload), everything is updated correctly. But when I switch from the first component to the second without reloading (or vice versa), the Redux-DevTool doesn't update anymore.

Maybe I'm missing some configuration or implemented it the wrong way... or is it a bug? After navigating I would have expected a new Entry in the Redux-DevTool Actions tab an two entries (one for each component) in the State.

Here is a minimalitic example: https://stackblitz.com/edit/stackblitz-starters-ehufa9?file=src%2Fapp%2Fapp.component.html

rainerhahnekamp commented 3 weeks ago

Hello @DanielPinkpank, I don't think you are missing there something. If a SignalStore with name "flights" is instantiated multiple times, what would you expect?

I'd say the first one is always "flights", and the following ones should be indexed. Like "flights-1", "flights-2", etc.?

DanielPinkpank commented 3 weeks ago

Yes, the stores already have different names (like in the stackblitz example). Here are some screenshots from my Redux DevTool. The 3. screenshot shows that the component is rendered correctly but the Redux DevTool isn't updated:

  1. navigating to the first component after reload: image

  2. navigating to the second component after reload: image

  3. navigating from the first to the second component: image

bsarnii commented 5 days ago

I’m experiencing a similar issue. I passed the signal-store to a component, but after the component is destroyed, the redux-devtools stop tracking actions from the other signal-stores.

rainerhahnekamp commented 5 days ago

Quick update on that. The fix will come with a different implementation and will be released with v19.