You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since they pass the same value as the task name, debounce does its job and calls the function only once because the calls happen within a short period of time.
Computed properties need to ensure the task names they pass to debounce are unique among all computed properties of a model.
If multiple computed properties call the same method but with different
arguments, calls to the method are debounced because they pass the same
value as the task name. Rather than name the task only the method name,
use the full expression to let the developer ensure uniqueness.
Example:
```js
computed: {
foo: 'computeClassName(bar)',
baz: 'computeClassName(xyz)'
}
```
Currently they both create property effects wrapped in debounce calls
with task names of '_computeClassName':
```js
this.debounce('_computeClassName', function() { ... })
this.debounce('_computeClassName', function() { ... })
```
By passing the full expression rather than the method name, they result
in unique debounce task names:
```js
this.debounce('_computeClassName(bar)', function() { ... })
this.debounce('_computeClassName(xyz)', function() { ... })
```
Fixes#1242
When pointing multiple computed properties to the same method but with different arguments, the output is unexpected.
https://gist.github.com/ssorallen/07337da2bbfb4929333a
Expected output when using the
multi-compute
element:Actual output:
The text was updated successfully, but these errors were encountered: