An open API service indexing awesome lists of open source software.

https://github.com/tsaidavid/vanilla-search-autocomplete

A vanilla JS implementation of a search w/ autocomplete
https://github.com/tsaidavid/vanilla-search-autocomplete

codesandbox javascript parcel search vanilla vanilla-javascript

Last synced: about 1 year ago
JSON representation

A vanilla JS implementation of a search w/ autocomplete

Awesome Lists containing this project

README

          

# vanilla-search-autocomplete
A vanilla JS implementation of a search w/ autocomplete

**Demo:**

[![Edit vanilla-search-autocomplete](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/github/tsaiDavid/vanilla-search-autocomplete/tree/master/)

## Features
- Good ol' vanilla JavaScript
- `parcel` for bundling
- *Debounced* input event handler
- A simple mocked API call (`searchData`) for movie titles and ratings
- `searchData() -> Promise`

## Thoughts
More times than not, focusing on the end user experience pushes you towards considering performance optimizations: a win-win.

In this case, we *debounced* the input event handler, which better helps us manage the number of calls, but also ensures a
more consistent experience for the user. Depending on your use case, you'll want to fine tune and experiment with the duration.