Skip to content

Conversation

@SevereOverfl0w
Copy link
Contributor

This makes the UI feel far less laggy while typing in a search query.
It avoids applying redundant searches, which can easily add up to ~150ms
per character on an older device or mobile phone.

@weavejester
Copy link
Owner

This seems fine in principle. Can we use rest arguments to make the debouncer more concise?

function debounce(f, wait){
  var timeout;
  return function(...args) {
    clearTimeout(timeout)
    timeout = setTimeout(f.bind(this, ...args), wait);
  }
}

Also instead of applySearch maybe filterProjectsBySearch?

var filterProjectsBySearch = debounce(function(query) {
  ...
}, 100);

@SevereOverfl0w
Copy link
Contributor Author

I've applied the rename suggestion.

The downside to using spread is that Internet Explorer support is non-existent. Is Internet Explorer support still a goal for clojure-toolbox?

@weavejester
Copy link
Owner

The downside to using spread is that Internet Explorer support is non-existent. Is Internet Explorer support still a goal for clojure-toolbox?

I don't believe it's ever been a goal. If someone needs IE support and raises an issue then we can revisit this, but I think it's safe to assume IE use amongst Clojure programmers is low to non-existent.

This makes the UI feel far less laggy while typing in a search query.
It avoids applying redundant searches, which can easily add up to ~150ms
per character on an older device or mobile phone.
@SevereOverfl0w
Copy link
Contributor Author

As that's the case, I've pushed a shorter implementation using ES6.

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