Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup some JSDocs related to observables #228739

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

pisv
Copy link
Contributor

@pisv pisv commented Sep 16, 2024

Mainly, this PR proposes to relax the constraint

Before the given observable can call this method again, is must call IObserver.endUpdate

in the JSDoc for the IObserver.beginUpdate method.

All existing observer implementations in VS Code are resilient to repeated calls of beginUpdate for the same observable, provided that each call is eventually accompanied with the corresponding endUpdate call. (All the implementations are based on using an update counter.)

Whereas the current implementation of ObservableValue does not satisfy this constraint when its set method is repeatedly called with the same transaction. (In that case, it will repeatedly call tx.updateObserver(observer, this), which will repeatedly call observer.beginUpdate(observable).)

@mjbvz mjbvz assigned hediet and unassigned mjbvz Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants