-
Notifications
You must be signed in to change notification settings - Fork 11
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
Make filteredRows rate-limited (throttled) #19
Comments
I've never thought about rate-limiting the |
That is a clever workaround! However, it won't handle row manipulation scenarios. For example, suppose the 10K city names are additional names you need to add to an existing repository. If the table is sorted, calling |
That's a really great point. I'll get that added in whenever I have a chance. |
TLDR, I propose the following:
There is an issue with rate-limiting the We can, however, use I also propose that we do use a |
Good thinking! Instead of rate-limiting the Also note that |
I'm inclined to think that rate-limiting the |
In that case perhaps rate-limit both? I admit it's not that important though, either or both will work well in most real-world scenarios (I still give |
Binding an input's
textInput
to the table'sfilter
property is very useful for incremental filtering. However, it may result in unnecessary processing of intermediate user input.For example, suppose you are bound to a list of 10K city names, and the user type in "Tokyo". On each keystroke ('T', 'o', 'k', and so forth) , the filter is re-evaluated which can be costly, especially on weaker machines.
In such cases it may be desirable to throttle changes to the
filteredRows
computed property. Fortunately, KO makes this extremely easy and it boils down to a singleextend
call. The desired throttling interval could be provided in theDataTable
constructor (if not specified, no throttling will take place).Deprecated API (for older KO versions): http://knockoutjs.com/documentation/throttle-extender.html
Current API: http://knockoutjs.com/documentation/rateLimit-observable.html
The text was updated successfully, but these errors were encountered: