Aurelia-store: should we unregister actions?

Hi folks,

We have plenty of actions that we need to register in our Store. We do it in app.ts only once in order to centralise it there.

Is that all right that we register all our actions, they could be 20, 30, maybe 50, and like, never unregister them? Why should I unregister them? Or, should I register only the actions related to a specific controller/route, and unregister them once I navigate elsewhere?

What are your thoughts? Thanks!

1 Like

Frankly I never thought about that in Detail. To be very honest the method came as a natural counterpart to register. Now that said I had one case where I would let 2 features register an action with the same name (as for devtools traceability) but do something different. While only one feature can be active I’d unregister to free up the slot. But this is a super edge case and I think you’re typically good with keeping actions around

2 Likes

Ok, that’s what I thought. So, we’re in the right path lol

Thanks again @zewa666

1 Like