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

Commit c155f07

Browse files
committed
chore(widget): add more defaults to avoid starting with failing TS
1 parent e48f9c6 commit c155f07

File tree

2 files changed

+24
-8
lines changed

2 files changed

+24
-8
lines changed

e2e/__snapshots__/templates.test.js.snap

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3661,7 +3661,9 @@ export const connectInstantsearchJsApp: InstantsearchJsAppConnector = function c
36613661
36623662
return {
36633663
...uiState,
3664-
// add this widget's ui state
3664+
instantsearchJsApp: {
3665+
// TODO: add this widget's ui state
3666+
}
36653667
};
36663668
},
36673669
@@ -3683,7 +3685,9 @@ export const connectInstantsearchJsApp: InstantsearchJsAppConnector = function c
36833685
getRenderState(renderState, renderOptions) {
36843686
return {
36853687
...renderState,
3686-
// call this.getWidgetRenderState(renderOptions)
3688+
instantsearchJsApp: {
3689+
// TODO: call this.getWidgetRenderState(renderOptions), possibly nested per attribute
3690+
}
36873691
};
36883692
},
36893693
@@ -3695,11 +3699,15 @@ export const connectInstantsearchJsApp: InstantsearchJsAppConnector = function c
36953699
getWidgetRenderState({ results }) {
36963700
if (!results) {
36973701
// default rendering state without results
3698-
return {};
3702+
return {
3703+
widgetParams,
3704+
};
36993705
}
37003706
37013707
// rendering state when there are results
3702-
return {};
3708+
return {
3709+
widgetParams,
3710+
};
37033711
},
37043712
};
37053713
};

src/templates/InstantSearch.js widget/src/connector.ts.hbs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@ export const connect{{ pascalCaseName }}: {{ pascalCaseName }}Connector = functi
7171

7272
return {
7373
...uiState,
74-
// add this widget's ui state
74+
{{ camelCaseName }}: {
75+
// TODO: add this widget's ui state
76+
}
7577
};
7678
},
7779

@@ -93,7 +95,9 @@ export const connect{{ pascalCaseName }}: {{ pascalCaseName }}Connector = functi
9395
getRenderState(renderState, renderOptions) {
9496
return {
9597
...renderState,
96-
// call this.getWidgetRenderState(renderOptions)
98+
{{ camelCaseName }}: {
99+
// TODO: call this.getWidgetRenderState(renderOptions), possibly nested per attribute
100+
}
97101
};
98102
},
99103

@@ -105,11 +109,15 @@ export const connect{{ pascalCaseName }}: {{ pascalCaseName }}Connector = functi
105109
getWidgetRenderState({ results }) {
106110
if (!results) {
107111
// default rendering state without results
108-
return {};
112+
return {
113+
widgetParams,
114+
};
109115
}
110116

111117
// rendering state when there are results
112-
return {};
118+
return {
119+
widgetParams,
120+
};
113121
},
114122
};
115123
};

0 commit comments

Comments
 (0)