UNPKG

@sendbird/uikit-react

Version:

Sendbird UIKit for React: A feature-rich and customizable chat UI kit with messaging, channel management, and user authentication.

21 lines (20 loc) 517 B
import { DependencyList } from 'react'; interface Request<Response> { (): Promise<Response>; cancel?(): void; } interface Options { resetResponseOnRefresh?: boolean; persistLoadingIfNoResponse?: boolean; deps?: DependencyList; } interface State<T, E = unknown> { loading: boolean; response?: T; error?: E; } interface Return<T> extends State<T> { refresh(): Promise<void>; } export declare function useAsyncRequest<T>(request: Request<T>, options?: Options): Return<T>; export {};