Skip to content

Commit

Permalink
chore: account for Node.js setTimeout return type (#6039)
Browse files Browse the repository at this point in the history
* chore: account for Node.js setTimeout return type

* chore: add zero to match first (Node) sig
  • Loading branch information
cartant authored Feb 22, 2021
1 parent 1aa400a commit 6f7cee5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions spec/observables/bindCallback-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,12 @@ describe('bindCallback', () => {
const nextSpy = sinon.spy();
const throwSpy = sinon.spy();
const completeSpy = sinon.spy();
let timeout: number;
let timeout: ReturnType<typeof setTimeout>;
function callback(datum: number, cb: Function) {
// Need to cb async in order for the unsub to trigger
timeout = setTimeout(() => {
cb(datum);
});
}, 0);
}
const subscription = bindCallback(callback)(42)
.subscribe(nextSpy, throwSpy, completeSpy);
Expand Down
4 changes: 2 additions & 2 deletions spec/observables/bindNodeCallback-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,12 @@ describe('bindNodeCallback', () => {
const nextSpy = sinon.spy();
const throwSpy = sinon.spy();
const completeSpy = sinon.spy();
let timeout: number;
let timeout: ReturnType<typeof setTimeout>;
function callback(datum: number, cb: (err: any, n: number) => void) {
// Need to cb async in order for the unsub to trigger
timeout = setTimeout(() => {
cb(null, datum);
});
}, 0);
}
const subscription = bindNodeCallback(callback)(42)
.subscribe(nextSpy, throwSpy, completeSpy);
Expand Down

0 comments on commit 6f7cee5

Please sign in to comment.