-
Notifications
You must be signed in to change notification settings - Fork 529
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(api): add namespace when storing widgets state
BREAKING CHANGE: - our internal state shape now includes namespacing to avoid id collision. Also some existing keys were renamed: * searchbox was using 'q' now it uses 'query' * hitsPerPage was using 'hPP' now it uses 'hitsPerPage' * pagination and infiniteHits were using 'p' now it uses 'page' For more information about the state shape, please read our documentation.
- Loading branch information
mthuret
committed
Nov 30, 2016
1 parent
8d7a8d0
commit 0186a6d
Showing
33 changed files
with
338 additions
and
154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
--- | ||
title: InstantSearch state | ||
layout: guide.pug | ||
category: guide | ||
navWeight: 600 | ||
--- | ||
|
||
The `InstantSearch` state contains all widgets states. | ||
If a widget uses an attribute, we store it under its widget category to prevent collision. | ||
|
||
Here's the `InstantSearch` state shape for all the connectors or widgets that we provide: | ||
|
||
### Range state | ||
|
||
```javascript | ||
{ | ||
range: { | ||
attributeName: { | ||
min: 'min_value', | ||
max: 'max_value' | ||
} | ||
} | ||
} | ||
``` | ||
### RefinementList state | ||
|
||
```javascript | ||
{ | ||
refinementList: { | ||
attributeName: ['value'] | ||
} | ||
} | ||
``` | ||
|
||
### HierarchicalMenu state | ||
|
||
```javascript | ||
{ | ||
hierarchicalMenu: { | ||
attributeName: 'value' | ||
} | ||
} | ||
``` | ||
|
||
### HitsPerPage state | ||
|
||
```javascript | ||
{ | ||
hitsPerPage: 10 | ||
} | ||
``` | ||
|
||
### Menu state | ||
|
||
```javascript | ||
{ | ||
menu: { | ||
attributeName: 'value' | ||
} | ||
} | ||
``` | ||
|
||
### MultiRange state | ||
|
||
```javascript | ||
{ | ||
multiRange: { | ||
attributeName: 'min_value:max_value' | ||
} | ||
} | ||
``` | ||
### Toggle state | ||
|
||
```javascript | ||
{ | ||
multiRange: { | ||
attributeName: 'on || off' | ||
} | ||
} | ||
``` | ||
|
||
### SortBy state | ||
|
||
```javascript | ||
{ | ||
sortBy: 'index_name' | ||
} | ||
``` | ||
|
||
### SearchBox state | ||
|
||
```javascript | ||
{ | ||
query: 'query_value' | ||
} | ||
``` | ||
|
||
### Pagination state | ||
|
||
```javascript | ||
{ | ||
page: 2 | ||
} | ||
``` | ||
|
||
### InfiniteHits state | ||
|
||
```javascript | ||
{ | ||
page: 2 | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.