npm.io
2.0.4 • Published 2 years ago

@types/react-cache

Licence
MIT
Version
2.0.4
Deps
0
Size
3 kB
Vulns
0
Weekly
0
Stars
51.4K

Installation

npm install --save @types/react-cache

Summary

This package contains type definitions for react-cache (https://github.com/facebook/react/tree/master/packages/react-cache).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-cache.

index.d.ts

export interface Resource<Input, Value> {
    read(key: Input): Value;
    preload(key: Input): void;
}

export function unstable_createResource<Input, Value>(
    fetch: (input: Input) => PromiseLike<Value>,
    maybeHashInput?: (input: Input) => string | number,
): Resource<Input, Value>;

Additional Details

  • Last updated: Tue, 07 Nov 2023 0939 GMT
  • Dependencies: none

Credits

These definitions were written by Spencer Miskoviak.