Skip to content

Commit

Permalink
refactor(react): replace undefined with null
Browse files Browse the repository at this point in the history
  • Loading branch information
exuanbo committed Jul 13, 2023
1 parent a005dda commit 51c4a38
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/react/src/utils/asyncScheduler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ interface AsyncScheduler {
}

export function createAsyncScheduler(): AsyncScheduler {
let cancelTimeout: CancelImmediateTimeout | undefined
let cancelTimeout: CancelImmediateTimeout | undefined | null
return {
request: (callback) => {
cancelTimeout = requestImmediateTimeout(() => {
cancelTimeout = undefined
cancelTimeout = null
callback()
})
},
cancel: () => {
if (cancelTimeout) {
cancelTimeout()
cancelTimeout = undefined
cancelTimeout = null
}
},
}
Expand Down

0 comments on commit 51c4a38

Please sign in to comment.