Skip to content

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