You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm migrating from on-change to using captureStoreUpdates().
When using captureStoreUpdates(), setting a new value mutable.settings.model = model will produce the path: ["settings"]. However, if I replace the entire settings object this will trigger more updates than just updating the settings.model property.
Suggest A Solution
I propose for an option or change in behavior where setting mutable.settings.model produces path: ["settings", "model"].
The text was updated successfully, but these errors were encountered:
astoilkov
changed the title
captureStoreUpdates return the full path to the property that changed
captureStoreUpdates — return the full path to the property that changed
Feb 28, 2024
astoilkov
changed the title
captureStoreUpdates — return the full path to the property that changedcaptureStoreUpdates — return the full path to the property that changed
Feb 28, 2024
astoilkov
changed the title
captureStoreUpdates — return the full path to the property that changedcaptureStoreUpdates — return the full path to the property that changed
Feb 28, 2024
captureStoreUpdates is returning the path to the object, not property, by design. It allows to simplify the implementation a lot—there is no easy way of checking which property was changed without cloning each object and diffing it.
It's not properly communicated in the readme, which need to be corrected.
I'm also not against adding another helper for diffing the objects that would wrap captureStoreUpdates. But captureStoreUpdates should remain as is, because getting the changed object is often what you need.
Describe The Problem To Be Solved
I'm migrating from
on-change
to usingcaptureStoreUpdates()
.When using
captureStoreUpdates()
, setting a new valuemutable.settings.model = model
will produce thepath: ["settings"]
. However, if I replace the entiresettings
object this will trigger more updates than just updating thesettings.model
property.Suggest A Solution
I propose for an option or change in behavior where setting
mutable.settings.model
producespath: ["settings", "model"]
.The text was updated successfully, but these errors were encountered: