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

AsyncObservable cannot return a value after previously resolving #13

Open
phillipskevin opened this issue Dec 27, 2017 · 1 comment
Open
Assignees
Labels

Comments

@phillipskevin
Copy link
Contributor

phillipskevin commented Dec 27, 2017

An AsyncObservable cannot return a value from its getter if resolve has already been called.

That means the observable below cannot be used to toggle from 0 to 1 and then back to 0:

	var asyncObs = new AsyncObservable(function(lastSet, resolve){
		if (value.get() === 1) {
			resolve(1);
		}

		return 0;
	});
@phillipskevin phillipskevin self-assigned this Dec 27, 2017
phillipskevin added a commit that referenced this issue Dec 27, 2017
@phillipskevin
Copy link
Contributor Author

Maybe what is strange about this is that the value ever becomes 1, since even when you resolve(1) you also then return 0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant