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

fix(AsyncAction): Make AsyncAction update its timeout if rescheduled before its executed #2580

Merged
merged 1 commit into from
May 2, 2017
Merged
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
4 changes: 2 additions & 2 deletions src/scheduler/AsyncAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ export class AsyncAction<T> extends Action<T> {

protected recycleAsyncId(scheduler: AsyncScheduler, id: any, delay: number = 0): any {
// If this action is rescheduled with the same delay time, don't clear the interval id.
if (delay !== null && this.delay === delay) {
if (delay !== null && this.delay === delay && this.pending === false) {
return id;
}
// Otherwise, if the action's delay time is different from the current delay,
// clear the interval id
// or the action has been rescheduled before it's executed, clear the interval id
return root.clearInterval(id) && undefined || undefined;
}

Expand Down