Skip to content
This repository was archived by the owner on Dec 30, 2022. It is now read-only.

Commit badf815

Browse files
authored
feat(InstantSearch): support onStateChange (#1149)
fixes #1148
1 parent a3ce1bc commit badf815

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/components/InstantSearch.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ export default createInstantSearchComponent({
4646
type: Function,
4747
default: undefined,
4848
},
49+
onStateChange: {
50+
type: Function,
51+
default: undefined,
52+
},
4953
initialUiState: {
5054
type: Object,
5155
default: undefined,
@@ -84,6 +88,7 @@ export default createInstantSearchComponent({
8488
routing: this.routing,
8589
stalledSearchDelay: this.stalledSearchDelay,
8690
searchFunction: this.searchFunction,
91+
onStateChange: this.onStateChange,
8792
initialUiState: this.initialUiState,
8893
}),
8994
};

src/util/createInstantSearchComponent.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@ export const createInstantSearchComponent = component =>
3030
'Please open a new issue: https://github.com/algolia/vue-instantsearch/issues/new?template=feature.md'
3131
);
3232
},
33+
onStateChange() {
34+
throw new Error(
35+
'onStateChange configuration can not be changed dynamically at this point.' +
36+
'\n\n' +
37+
'Please open a new issue: https://github.com/algolia/vue-instantsearch/issues/new?template=feature.md'
38+
);
39+
},
3340
searchFunction(searchFunction) {
3441
// private InstantSearch.js API:
3542
this.instantSearchInstance._searchFunction = searchFunction;

0 commit comments

Comments
 (0)