Skip to content

Commit

Permalink
fix(PagerProcessor): empty array returned on page change
Browse files Browse the repository at this point in the history
Fix a bug where setting the page number on a disabled PagerProcessor
would return an empty array.

fixes #29
  • Loading branch information
pathurs committed Aug 2, 2018
1 parent 5aab48c commit 17470c5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/processors/complex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ export abstract class ComplexProcessor<TData> extends BehaviourSubject<TData> im
return data;
}

return this.next(this.processor(data));
const processedData = this.processor(data);

return this.next(processedData);
}

/**
Expand Down
4 changes: 3 additions & 1 deletion src/processors/pager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ export class PagerProcessor<TEntry> extends ArrayProcessor<TEntry> implements Pa

this._page = page;

this.next(this.currentPageEntries());
if (this.shouldProcess()) {
this.next(this.currentPageEntries());
}
}

// tslint:disable-next-line:variable-name
Expand Down

0 comments on commit 17470c5

Please sign in to comment.