Is your feature request related to a problem? Please describe.
Describe the solution you'd like
I have a program need to automatically subscribe the change to the data, so for example using onPatch to capture an "add" operation, in the call back subscribing the further change from other clients(with websocket communication) then apply the change to the node, but since there is no such argument I have to use the store instance and lookup the node then apply change.
so my patch fuction is a generic process, something like:
onPatch(userStore, (patch, node)=>triggerUpdate(patch, node))
function triggerUpdatePatch(patch, node) {
case "add":
subscribeChange(data=> {
applySnapshot(node, data) // this makes the function operate dynamically
})
}
and then, I can use onPatch(orderStore, (patch, node)=>triggerUpdate(patch, node)) for the generic usage.
Feature request
Is your feature request related to a problem? Please describe.
Describe the solution you'd like
I have a program need to automatically subscribe the change to the data, so for example using
onPatch
to capture an "add" operation, in the call back subscribing the further change from other clients(with websocket communication) then apply the change to the node, but since there is no such argument I have to use the store instance and lookup the node then apply change.so my patch fuction is a generic process, something like:
and then, I can use
onPatch(orderStore, (patch, node)=>triggerUpdate(patch, node))
for the generic usage.Describe alternatives you've considered
Additional context
Are you willing to (attempt) a PR?