From 40c9406c5f0d477324a2e9061c75241f6debad6e Mon Sep 17 00:00:00 2001 From: Raymond Rutjes Date: Wed, 7 Feb 2018 13:47:52 +0100 Subject: [PATCH] docs(integrate-with-nuxt): add missing method call (#391) --- docs/src/advanced/integrate-with-nuxt.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/src/advanced/integrate-with-nuxt.md b/docs/src/advanced/integrate-with-nuxt.md index 130e8db15..3de73788e 100644 --- a/docs/src/advanced/integrate-with-nuxt.md +++ b/docs/src/advanced/integrate-with-nuxt.md @@ -126,6 +126,7 @@ searchStore.indexName = 'bestbuy' export default { async asyncData () { searchStore.start() + searchStore.refresh() await searchStore.waitUntilInSync() return { serializedSearchStore: searchStore.serialize() } @@ -148,7 +149,7 @@ First thing to notice is that you now [manually pass down the search store](gett This allows you to have a better control over the lifecycle of the search. In the `asyncData` method, multiple things happen: -1. you first manually start the store which will launch the first query to Algolia `searchStore.start()` +1. you first manually start & refresh the store which will launch the first query to Algolia `searchStore.start()` && `searchStore.refresh()` 2. you then wait for the query to be done so that you get all the results in the store with `store.waitUntilInSync()` method 3. you return the serialized version of the store so that it can be passed to the frontend `return { serializedSearchStore: searchStore.serialize() }`