Skip to content

Commit

Permalink
fix(loop): Fix task loop on NodeJS
Browse files Browse the repository at this point in the history
  • Loading branch information
kofno committed Jan 12, 2019
1 parent 923c3ef commit eaa3f34
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,11 @@ class Task<E, T> {
*/
public static loop<E, T>(interval: number, task: Task<E, T>): Task<never, T> {
return new Task<never, T>((_, resolve) => {
let timeout: number | undefined;
let timeout: any;
const loop = () => {
task.fork(
() => {
timeout = window.setTimeout(loop, interval);
timeout = setTimeout(loop, interval);
},
result => resolve(result)
);
Expand Down
1 change: 1 addition & 0 deletions tslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"arrow-parens": [true, "ban-single-arg-parens"],
"quotemark": [true, "single", "avoid-escape"],
"no-construct": false,
"no-shadowed-variable": false,
"trailing-comma": [
true,
{
Expand Down

0 comments on commit eaa3f34

Please sign in to comment.