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

Document.onRelease() should be private? #31

Open
hajimetakase opened this issue May 31, 2021 · 0 comments
Open

Document.onRelease() should be private? #31

hajimetakase opened this issue May 31, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@hajimetakase
Copy link

I think if Document.onRelease() is executed before the commit(), then the data could be corrupted(because it does incrementValue = null;

incrementValue = null;
).
So maybe Document.onRelease() should be private?

Also, I sometime wants to access to Document.value after the increment, so maybe there should be some field like Document.promisedValue which return the value after the commit() beforehand.

int get promisedValue => { 
if (incrementValue != null) {
        final _value =
            value != null ? value! + incrementValue! : incrementValue;
        result = Increment<T>(value: _value! as T);
      } else {
        result = Increment<T>(value: value);
      }
return result.value
}
@hukusuke1007 hukusuke1007 added the enhancement New feature or request label May 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants