Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/Store.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
isPlainObject,
result,
uniqBy,
debounce,
} from 'lodash';
import { invariant } from './utils';
const AVAILABLE_CONST_OPTIONS = [
Expand Down Expand Up @@ -334,14 +335,16 @@ export default class Store {
getNextPage() {
invariant(this.hasNextPage, 'There is no next page.');
this.__state.currentPage += 1;
return this.fetch();
const debouncedFetch = debounce(this.fetch, 300)
return debouncedFetch();
}

@action
getPreviousPage() {
invariant(this.hasPreviousPage, 'There is no previous page.');
this.__state.currentPage -= 1;
return this.fetch();
const debouncedFetch = debounce(this.fetch, 300)
return debouncedFetch();
}

@action
Expand Down