API Reference
/
InstantSearch.js
/
simple
May. 12, 2022
simple
Signature
const routing = { stateMapping: instantsearch.stateMappings.simple(), };
About this widget
You are currently reading the documentation for InstantSearch.js V4. Read our migration guide to learn how to upgrade from V3 to V4. You can still access the V3 documentation for this page.
The simple
state mapping is used by default within instantsearch
.
The only transformation applied by the function is the omission of configure
.
Copy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
instantsearch.stateMappings.simple().stateToRoute({
instant_search: {
query: 'Apple',
page: 5,
configure: {
hitsPerPage: 4,
},
},
});
// gives as output:
// {
// instant_search: {
// query: 'Apple',
// page: 5,
// },
// }
Examples
Copy
1
2
3
4
5
6
instantsearch({
// ...
routing: {
stateMapping: instantsearch.stateMappings.simple(),
},
});
Did you find this page helpful?