updating nested object not triggering update
Heya I'm fairly new to SolidJS (You might have already seen some of my previous post of me strugglin' :D)
I'm trying to update the state of a nested object in a store but it doesn't seem to trigger an update on my component.
here is the method I use to update (it's declared in a context provider)
I'm not sure if I'm using produce well
10 Replies
this won't work
but the mutations that happen below, they look fine. Not sure exackly what _.merge does but if it mutates the object on the left with differences from the right, then thats fine
it's a method from lodash to merge objects https://lodash.com/docs/#merge
looks like
reconcile
I did this in my component to check if it update is this right ?
oh ?
I checked the api but couldn't understand quite well reconcile
or not, becasue it adds new keys
this won't listen to anything
You could do this
if you move this one key up, it should help with no features case
alright it seems to work now I need to find why the component won't update ^^' I'm using a fairly complicated setud with solid-map-gl and trying to update a geojson layer
oh nice thanks for the tip
can I continue to chain up argument after a produce, for example
no
use a separate store setter after it
The last param is for setting the value, the ones before for deciding on the path to the property
alright
Is there any way I can thank you like buy you a coffee or something ? you've helped me quite a few times already
thanks but I don't have anything like that setup
I'm answering posts mostly for fun anyway
Alright then you have my most sincere thanks for your time 😄 and I might come here again soon x)