AboutSupportDeveloper GuideVersion 19.1.23

Type alias HomeSearchListenerResponse

HomeSearchListenerResponse: Omit<CLISearchListenerResponse, "respond" | "updateContext"> & {
    respond(results) => void;
    updateContext(context) => void;
}

Representation of a search response from a specific invocation of a HomeProvider's onUserInput listener function. Can optionally be used to push search results to the Home UI.

Type declaration

  • respond:function
  • updateContext:function
    • Pushes a new context to the Home UI. This can be used to update the search filters

      Parameters

      Returns void

Example

function onUserInput(req: HomeSearchListenerRequest, res: HomeSearchListenerResponse) {
searchListenerResponse.open();

const myLongRunningQuery = makeMyLongRunningQuery(searchListenerRequest.query);
myLongRunningQuery.onNewResults(myNewResults => {
searchListenerResponse.respond(myNewResults);
});

searchListenerRequest.onClose(() => {
myLongRunningQuery.close();
});

// return any search results that are immediately available
return quickQuery.getResults();
}