Open w7tf opened 1 month ago
The observable should be updated automatically with the saved value from create and update, as long as those return with the updated values (which it seems like they do). So this shouldn't be necessary at all. Are they not updating automatically?
The observable should be updated automatically with the saved value from create and update, as long as those return with the updated values (which it seems like they do). So this shouldn't be necessary at all. Are they not updating automatically?
They are updating automatically if as
is set to object
, it does not work if as
is set to array
Oh gotcha! Ok I've reproduced it in a test and will fix it.
For what it's worth I'd recommend probably not using as: 'array'. It's usually much easier to update items in an object or Map by id, whereas with an array you end up running find
a lot.
Oh gotcha! Ok I've reproduced it in a test and will fix it.
For what it's worth I'd recommend probably not using as: 'array'. It's usually much easier to update items in an object or Map by id, whereas with an array you end up running
find
a lot.
Yeah good input thanks! I forgot to think about O-complexity when I set it to use as array. Apart from the Object.values(obj) syntax when listing the whole state it makes much more sense to as object. Will refactor the store to use as object.
Ok cool, sounds good! I have a fix coming in the next patch but I won't rush it since you don't need it urgently :)
Currently onSaved is done the following way: