deno.land / x / rambda@v9.1.1 / source / wait-spec.ts

نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import {wait, delay} from 'rambda'
describe('R.wait', () => { it('with promise', async() => { const [result, err] = await wait(delay(100)) result // $ExpectType "RAMBDAX_DELAY" err // $ExpectType Error | undefined })
it('with async function', async() => { const fn = async(x: number) => { await delay(100) return x + 1 } const [result, err] = await wait(fn) result // $ExpectType number err // $ExpectType Error | undefined })})
rambda

Version Info

Tagged at
2 months ago