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

Ignore spurious canExecute changes #49

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

Conversation

rockResolve
Copy link

canExecute is frequently set to a truthy value e.g. !isExecuting &&
order() && order().amount() > 0.
Knockout dependancy triggers updating canExecute whenever any of the observables changes resulting in spurious updates to subscribers e.g. Activity.

Coerce canExecuteDelegate value to a boolean to ignore spurious updates being pushed to subscribers

canExecute is frequently set to a truthy value e.g. !isExecuting &&
order() && order().amount() > 0. Knockout dependancy triggers updating
this whenever any of the observables changes resulting in spurious
updates to subscribers e.g. Activity.
Coerce to a boolean to ignore spurious updates
@IanYates
Copy link

IanYates commented May 1, 2015

I hadn't noticed this problem myself, but the change makes sense to me

@rockResolve
Copy link
Author

Only noticed this while deep debugging another issue. Many canExecute delegates have dependancies on an entire model (e.g. order) and as a result every change to the model triggers a truthy update to subscribers regardless of the boolean value

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.

2 participants