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

memoize-spec.ts
نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import {memoize, delay} from 'rambda'
describe('memoize', () => { test('synchronous function', () => { const fn = (x: number, y: number) => x + y const memoized = memoize(fn) const result = memoized(1, 2) result // $ExpectType number }) test('asynchronous function', async() => { const fn = async(x: number, y: number) => { await delay(100) return x + y } const memoized = memoize(fn) const result = await memoized(1, 2) result // $ExpectType number })})
rambda

Version Info

Tagged at
2 months ago