Skip to content

Commit f96671c

Browse files
author
Alexandre Stanislawski
committed
feat(connector): Fix parameters for toggle connector
1 parent ce41cde commit f96671c

File tree

2 files changed

+5
-15
lines changed

2 files changed

+5
-15
lines changed

src/connectors/toggle/connectToggle.js

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,8 @@ const usage = `Usage:
88
var customToggle = connectToggle(function render(params, isFirstRendering) {
99
// params = {
1010
// value,
11-
// state,
1211
// createURL,
1312
// refine,
14-
// helper,
15-
// isFirstSearch,
1613
// instantSearchInstance,
1714
// }
1815
});
@@ -35,13 +32,10 @@ Full documentation available at https://community.algolia.com/instantsearch.js/c
3532

3633
/**
3734
* @typedef {Object} ToggleRenderingOptions
38-
* @property {Object} value
39-
* @property {Object} state
40-
* @property {function} createURL
41-
* @property {function} refine
42-
* @property {Object} helper
43-
* @property {boolean} isFirstSearch
44-
* @property {InstantSearch} instantSearchInstance
35+
* @property {Object} value the value of the toggle with `name`, `isRefined`, `count`, `onFacetValue` and `offFacetValue`
36+
* @property {function} createURL the function to create a url for the next state
37+
* @property {function} refine updates to the next state
38+
* @property {InstantSearch} instantSearchInstance the instance of instantsearch on which the widget is attached
4539
*/
4640

4741
/**
@@ -131,11 +125,8 @@ export default function connectToggle(renderFn) {
131125

132126
renderFn({
133127
value,
134-
state: helper.state,
135128
createURL: this._createURL,
136129
refine: this.toggleRefinement,
137-
helper,
138-
isFirstSearch: true,
139130
instantSearchInstance,
140131
}, true);
141132
},
@@ -180,7 +171,6 @@ export default function connectToggle(renderFn) {
180171
createURL: this._createURL,
181172
refine: this.toggleRefinement,
182173
helper,
183-
isFirstSearch: false,
184174
instantSearchInstance,
185175
}, false);
186176
},

src/widgets/toggle/toggle.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ const renderer = ({
2323
templates,
2424
transformData,
2525
}) => ({
26-
refine,
2726
value,
2827
createURL,
28+
refine,
2929
instantSearchInstance,
3030
}, isFirstRendering) => {
3131
if (isFirstRendering) {

0 commit comments

Comments
 (0)