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
As the title describes, when you pause observers attached to an observable proxy, changes are still tracked. When the observer is resumed, any changes made while paused are also reported.
the result will log both changes, despite one being made while the observer is paused.
I don't know if this is intended behavior or not, but to me it definitely feels like an oversight. This little issue cost me the better part of 2 weeks of headaches.
to both places that you do changes.push() and then filter the results in my observer function. I took this approach as the change seems 100% non-breaking to the existing code base.
The text was updated successfully, but these errors were encountered:
I think both behaviors are wanted. If we want to emulate manual batching of changes, first, we pause the changes and resume to consume all of them in one batch.
Another case is to discard the changes if the change capture is paused.
Maybe having and explicit API to describe the wanted behavior should be fine
I think both behaviors are wanted. If we want to emulate manual batching of changes, first, we pause the changes and resume to consume all of them in one batch. Another case is to discard the changes if the change capture is paused.
Maybe having and explicit API to describe the wanted behavior should be fine
Thanks
Thanks for replying. I think the cleanest approach is to just flag changes as they occur with the flag I indicated in my example. It's a very small change but gives more control without complicating the API or having to worry about breaking changes. Then developers can just use the flag as part of their callback when the updates occur.
As the title describes, when you pause observers attached to an observable proxy, changes are still tracked. When the observer is resumed, any changes made while paused are also reported.
the result will log both changes, despite one being made while the observer is paused.
I don't know if this is intended behavior or not, but to me it definitely feels like an oversight. This little issue cost me the better part of 2 weeks of headaches.
My solution was just to add
to both places that you do changes.push() and then filter the results in my observer function. I took this approach as the change seems 100% non-breaking to the existing code base.
The text was updated successfully, but these errors were encountered: