Detect which dependency changed when using "on" utility with createEffect
Hi, I have the code below:
I have a store called dataStore which is an object with 50+ properties.
I have a string array called triggerFields which correspond to the property names in dataStore.
I want this effect to only run when the trigger fields change. So far I have managed to get this to work by simple accessing the particular properties (i.e the string values in TriggerFields) of dataStore.
However now inside my effect, I actually want to figure out which of my triggerField was responsible for the effect to run.
Any ideas on how I can accomplish this?
2 Replies
Extra question, is there any better way for me to track only particular properties of a store? I feel like what im doing here:
Might not be the best way to do it
You could probably do something like this
https://playground.solidjs.com/anonymous/06e30a32-4d3e-4935-8bb1-715fb3a94f70
Solid Playground
Quickly discover what the solid compiler will generate from your JSX template