Skip to content

Commit

Permalink
feat(templates): add "future" flags (#5904)
Browse files Browse the repository at this point in the history
  • Loading branch information
Haroenv committed Oct 25, 2023
1 parent b2bcae0 commit 08305b9
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2562,6 +2562,7 @@ const searchClient = algoliasearch('appId', 'apiKey');
const search = instantsearch({
indexName: 'indexName',
searchClient,
future: { preserveSharedStateOnUnmount: true },
});
search.addWidgets([
Expand Down Expand Up @@ -4749,6 +4750,8 @@ import './App.css';
const searchClient = algoliasearch('appId', 'apiKey');
const future = { preserveSharedStateOnUnmount: true };
export function App() {
return (
<div>
Expand All @@ -4768,6 +4771,7 @@ export function App() {
<InstantSearch
searchClient={searchClient}
indexName=\\"indexName\\"
future={future}
insights
>
<Configure hitsPerPage={8} />
Expand Down Expand Up @@ -5762,7 +5766,11 @@ exports[`Templates Vue InstantSearch with Vue 3 File content: src/App.vue 1`] =
</header>
<div class=\\"container\\">
<ais-instant-search :search-client=\\"searchClient\\" index-name=\\"indexName\\">
<ais-instant-search
:search-client=\\"searchClient\\"
index-name=\\"indexName\\"
:future=\\"future\\"
>
<ais-configure :hits-per-page.camel=\\"8\\" />
<div class=\\"search-panel\\">
<div class=\\"search-panel__filters\\">
Expand Down Expand Up @@ -5812,6 +5820,7 @@ export default {
data() {
return {
searchClient: algoliasearch('appId', 'apiKey'),
future: { preserveSharedStateOnUnmount: true },
};
},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const searchClient = algoliasearch('{{appId}}', '{{apiKey}}');
const search = instantsearch({
indexName: '{{indexName}}',
searchClient,
future: { preserveSharedStateOnUnmount: true },
{{#if flags.insights}}insights: true,{{/if}}
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ const searchClient = algoliasearch(
'{{apiKey}}'
);

const future = { preserveSharedStateOnUnmount: true };

export function App() {
return (
<div>
Expand All @@ -47,7 +49,7 @@ export function App() {
</header>

<div className="container">
<InstantSearch searchClient={searchClient} indexName="{{indexName}}" {{#if flags.insights}}insights{{/if}}>
<InstantSearch searchClient={searchClient} indexName="{{indexName}}" future={future} {{#if flags.insights}}insights{{/if}}>
<Configure hitsPerPage={8} />
<div className="search-panel">
<div className="search-panel__filters">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<ais-instant-search
:search-client="searchClient"
index-name="{{indexName}}"
:future="future"
{{#if flags.insights}}insights{{/if}}
>
<ais-configure :hits-per-page.camel="8" />
Expand Down Expand Up @@ -85,6 +86,7 @@ export default {
data() {
return {
searchClient: algoliasearch('{{appId}}', '{{apiKey}}'),
future: { preserveSharedStateOnUnmount: true },
};
},
};
Expand Down

0 comments on commit 08305b9

Please sign in to comment.