0.1.0 • Published 6 years ago

whereiswaldo v0.1.0

Weekly downloads
4
License
MIT
Repository
github
Last release
6 years ago

Where Is Waldo

Where is Waldo is a search bar with suggestions based on the list you provide.

Usage

import search from 'where-is-waldo';

//...

var mySearchBar = Searchbar({
  rootElement: ".js-searchBar",           // parent selector
  list: myListOfThings,                   // list of things you want to suggest
  handleSuggestionClick: function (e) {   // callback function
  },
  handleFormSubmit: function(e) {         // callback function
  }
});

mySearchBar.init();

Update the list

If you need to reflect changes in the list of suggestions, you can re-assign a new filtered list :

mySearchBar.setList(myFilteredListOfThings);