question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Refresh results in single page application

See original GitHub issue

After adding new record, instant search <ais-results> does not update. I need a way to show new items. Is there any solution?

<ais-results>
	<template scope="{ result }">
		<li class="list-group-item">
			<a href="#"><strong><ais-highlight :result="result" attribute-name="name"/></strong></a>
		</li>
	</template>
</ais-results>

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:22 (13 by maintainers)

github_iconTop GitHub Comments

2reactions
rayrutjescommented, Aug 4, 2017

Hey @a4anes , I think adding a method refresh to the search store makes sense. This method would take care of clearing the underlying Algolia client’s cache, and fetch the results again.

Would that work for you?

1reaction
ilearniocommented, Apr 19, 2018

This is how I refresh results

// In template
<ais-index ref="aisIndex" ...>
  ...
</ais-index>

// In "methods"
refreshResults () {
  if (this.$refs.aisIndex) {
    const searchStore = this.$refs.aisIndex._localSearchStore
    searchStore.clearCache()
    searchStore.refresh()
  }
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Single page application page refresh - angular - Stack Overflow
I know we can store the data in localstorage/cookies and use that data during loading of any route but is any better way...
Read more >
How to refresh a Single Page Application (SPA) - Kotive
3) If a new version of the web app is available, we simply refresh the page the next time the web app's route...
Read more >
Can you please refresh (Or how we version our Single-Page ...
A single-page application (SPA) is a web application or web site that interacts with the user by dynamically rewriting the current page rather ......
Read more >
What is a Single Page Application (SPA)? - Kadiska
A Single Page Application (SPA) is a web application that consists of a single HTML page. Instead of refreshing the whole page after...
Read more >
DOs and DONTs of Refreshes, Single-Page-Apps, and Short ...
One common question we get from publishers is whether they can run up impressions using refreshes, single-page-apps (SPA), or short-form content (articles,
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found