immense / immense/knockout-datatable

Make filteredRows rate-limited (throttled)

Open
#19 7 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
28
Forks
11
PR merge metrics
No merged PRs in 30d

Description

Binding an input's `textInput` to the table's `filter` 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 single `extend` call. The desired throttling interval could be provided in the `DataTable` 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

Contributor guide

No contributing guide indexed for this repository

Research direction

Inspect the DataTable constructor and the filteredRows computed property to find where the filtering observable is created. Use the current rateLimit observable API, preserving no throttling when no interval is supplied; done means configurable throttling works for incremental input without changing the default behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.