Skip to content

Commit

Permalink
any type for simplicity
Browse files Browse the repository at this point in the history
  • Loading branch information
dai-shi committed Nov 10, 2023
1 parent 3f41975 commit 03cd68a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
3 changes: 1 addition & 2 deletions tests/async.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ const sleep = (ms: number) =>
})

const { use } = ReactExports as any // for TS < 4.3 FIXME later
type Awaited<T> = T extends Promise<infer V> ? V : T // for TS < 4.5 FIXME later
const use2 = <T,>(x: T): Awaited<T> => (x instanceof Promise ? use(x) : x)
const use2 = (x: any) => (x instanceof Promise ? use(x) : x)

it.skipIf(typeof use === 'undefined')('delayed increment', async () => {
const state = proxy<any>({ count: 0 })
Expand Down
3 changes: 1 addition & 2 deletions tests/computed.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ import { proxy, snapshot, subscribe, useSnapshot } from 'valtio'
import { addComputed, proxyWithComputed, subscribeKey } from 'valtio/utils'

const { use } = ReactExports as any // for TS < 4.3 FIXME later
type Awaited<T> = T extends Promise<infer V> ? V : T // for TS < 4.5 FIXME later
const use2 = <T,>(x: T): Awaited<T> => (x instanceof Promise ? use(x) : x)
const use2 = (x: any) => (x instanceof Promise ? use(x) : x)

const consoleWarn = console.warn
beforeEach(() => {
Expand Down
3 changes: 1 addition & 2 deletions tests/derive.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ const sleep = (ms: number) =>
})

const { use } = ReactExports as any // for TS < 4.3 FIXME later
type Awaited<T> = T extends Promise<infer V> ? V : T // for TS < 4.5 FIXME later
const use2 = <T,>(x: T): Awaited<T> => (x instanceof Promise ? use(x) : x)
const use2 = (x: any) => (x instanceof Promise ? use(x) : x)

it('basic derive', async () => {
const computeDouble = vi.fn((x: number) => x * 2)
Expand Down

0 comments on commit 03cd68a

Please sign in to comment.