ResponseObject

Methods

res.add(result)

res.add(results)

You can add your SearchResult to ResultList in the app by calling this function

res.remove(id)

You can remove a SearchResult that you did add using the identifier.

You can use it for sending(adding) or removing SearchResults. and it is always provided as second argument of search(query, res) function.

Note
All function calls will be ignored when user has changed input.

Example

function search(query, res) {
  res.add({
    id: 'temp',
    title: 'Fetching...',
    desc: 'Please wait a second'
  });
  setTimeout(() => res.remove('temp'), 1000);
}