Skip to content

Commit

Permalink
Merge pull request #276 from automerge/remove-unused-rejectontimeout
Browse files Browse the repository at this point in the history
Remove unused function
  • Loading branch information
pvh authored Jan 23, 2024
2 parents ee7339e + 9c08f35 commit 3550721
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions packages/automerge-repo/src/helpers/pause.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,4 @@
export const pause = (t = 0) =>
new Promise<void>(resolve => setTimeout(() => resolve(), t))

export function rejectOnTimeout<T>(
promise: Promise<T>,
millis: number
): Promise<T> {
return Promise.race([
promise,
pause(millis).then(() => {
throw new Error("timeout exceeded")
}),
])
}

/* c8 ignore end */

0 comments on commit 3550721

Please sign in to comment.