Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: rename reload to refresh (vue-instantsearch consistency) #2645

Merged
merged 1 commit into from
Jan 2, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions dev/app/builtin/stories/reload.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import { storiesOf } from 'dev-novel';
import instantsearch from '../../../../index';
import { wrapWithHits } from '../../utils/wrap-with-hits.js';

const stories = storiesOf('Reload');
const stories = storiesOf('Refresh');

export default () => {
stories.add(
'default',
wrapWithHits(container => {
const button = document.createElement('button');
button.addEventListener('click', () => window.search.reload());
button.innerHTML = 'Reload InstantSearch';
button.addEventListener('click', () => window.search.refresh());
button.innerHTML = 'Refresh InstantSearch';
const searchBoxContainer = document.createElement('div');
window.search.addWidget(
instantsearch.widgets.searchBox({ container: searchBoxContainer })
Expand Down
4 changes: 2 additions & 2 deletions src/lib/InstantSearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,11 +200,11 @@ Usage: instantsearch({
}

/**
* The reload method clears the cached answers from Algolia and triggers a new search.
* The refresh method clears the cached answers from Algolia and triggers a new search.
*
* @return {undefined} Does not return anything
*/
reload() {
refresh() {
if (this.helper) {
this.helper.clearCache().search();
}
Expand Down