See live demo on GitHub Pages.
Hacker News feed search with autocomplete. Inspired by Google search.
# Clone the repo
git clone https://github.com/alex996/hacker-news-search.git
cd hacker-news-search
# Install deps
npm install
# Launch dev server
npm start
# Build prod bundle
npm run build
# Serve on localhost
npm run serve
- autocomplete search when typing
- story with a title, link, author, & score
- React with Algolia API
- timeout is laggy; perhaps decrease it or use debounce instead
- typeahed could be more like Algolia with paginated results, or
- autocomplete
input
(empty) + virtual list ofquery=''
results, scrollable - on type, fetch new results (or potentially, filter initial results?), update virtual list
- autocomplete
- also allow to use arrow keys (a11y)
- allow to choose number of results
- use an a11y lib, e.g.
downshift
- use UI lib, e.g.
bulma
etc. - split into logical components (
Input
,Stories
,Story
) - optimize rendering
useMemo
on list item to avoid wasteful rendersuseCallback
to memoize callbacks
- styling would not scale, split it by component e.g.
/Input/style.scss
- also make it scoped by tweaking the style loader
- implement caching in local storage (?)