Skip to content

Commit

Permalink
fix: return type + sleep
Browse files Browse the repository at this point in the history
  • Loading branch information
LiamMartens committed Nov 26, 2023
1 parent 9d108bc commit b318437
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/vanilla/utils/watch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ type Cleanup = () => void
type WatchGet = <T extends object>(proxyObject: T) => T
type WatchCallback = (
get: WatchGet,
) => Cleanup | void | Promise<void> | Promise<Cleanup> | undefined
) => Cleanup | void | Promise<void | Cleanup> | undefined
type WatchOptions = {
sync?: boolean
}
Expand Down
4 changes: 2 additions & 2 deletions tests/watch.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ describe('watch', () => {

const callback = vi.fn()

const waitPromise = sleep(0)
const waitPromise = sleep(10000)
watch(async (get) => {
await waitPromise
get(reference)
Expand All @@ -140,7 +140,7 @@ describe('watch', () => {

const callback = vi.fn()

const waitPromise = sleep(0)
const waitPromise = sleep(10000)
const stop = watch(async (get) => {
await waitPromise
get(reference)
Expand Down

0 comments on commit b318437

Please sign in to comment.