-
Notifications
You must be signed in to change notification settings - Fork 767
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
throttle issue using mapping #134
Comments
If it doesn't evaluate every time, how is it going to count to 100 (your throttle limit?) before notifying dependents? It sounds like the behavior is correct, no? |
no. as I understand "throttle" (and that is how it works without mapping) is I create ko.computed with throttle(100ms) that depends on some property, if this property changes 10 times in 100ms ko.computed should evaluate only once (100ms after last property update) - that seems as purpose of throttle, is it not? |
This is fixed in 046fce9. @dzjosjusuns Can you confirm? |
Yes, great, thank you! |
Problems is such - if I create ko.computed(..).extend({ throttle: 100 }) and computed is dependent on some observable array and observable items in that array, function is evaluated every time each item is changed in array ignoring "throttle". But interesting thing is that if I subscribe to this computed, subscribe is triggered only once (but still computed function is evaluated every time).
Problem can bee seen here - http://jsfiddle.net/dzjosjusuns/wc9ZS/2/
When I click top checkbox, each sub-checkbox is checked, and you can see at the top number of times ko.computed is called (every time +6)
In principle same example but without mapping (and working throttle) - http://jsfiddle.net/dzjosjusuns/wc9ZS/
When click top checkbox, each sub-checkbox is checked, and ko,computed is called only once (every time +1)
The text was updated successfully, but these errors were encountered: