Naming Action on Update #473
Unanswered
pkrzyzowski
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey,
I'm wondering if modifying the update function a bit to allow developers to "name" the reducers would be a good idea.
The motivation behind it is that doing so, will make it easier to traverse through multiple store updates in devtools.
Right now, any update in the store, creates a generic action in devtools, for example this reducer:
layoutStore.update(setProps(x => ({SidebarOpened: true})));
Would generate an action called:
[Layout] - Update store
in devtools.If update function would allow us to provide a string with the name the action that triggered the update like this:
layoutStore.update(setProps(x => ({SidebarOpened: true})), 'Opened sidebar');
Then devtools could show:
[Layout] - Opened sidebar
.I'm a new elf user, so there is a high chance that I'm wrong here, but I think that right now the only way to achieve that traceability is to create an action and effect which will trigger the update.
What do you think?
Beta Was this translation helpful? Give feedback.
All reactions