Usage
Context exposes asetContext function,
which takes an object and merges it with the existing context.
You can then access the context in state.context.
The following example stores the number of hits from an Algolia response,
making it accessible everywhere in your autocomplete.
JavaScript
JavaScript
Reference
ThesetContext function is accessible on your autocomplete instance.
Itβs also provided in:
getSourcesonSubmitonResetsource.onActivesource.onSelectsource.getItemsplugin.subscribe
context object is available on the state object.
(value: Record<string, unknown>) => void
The function to pass data to store it in the context.
Record<string,unknown>
The context to read data from.