Skip to content

Commit

Permalink
feat(core): rename reload to refresh (#2645)
Browse files Browse the repository at this point in the history
Reason: for consistency with vue-instantsearch .
  • Loading branch information
bobylito committed Jan 2, 2018
1 parent b3185e5 commit 9b8ac65
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
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

0 comments on commit 9b8ac65

Please sign in to comment.