valync
Version:
**A lightweight, framework-agnostic async data handling library for React & Vue, inspired by Riverpod’s AsyncValue pattern and powered by ts-results-es.**
6 lines • 544 B
TypeScript
import { ApiResponse, AsyncValue, ValyncOptions } from "../core";
export declare function createValyn({ client, }: {
client: (url: string, init: RequestInit) => Promise<ApiResponse<any>>;
}): <T>(key: string | Record<string, any>, options?: ValyncOptions<T>) => [AsyncValue<T>, () => void, (updater: (prev: T | null) => T) => void];
export declare function useValync<T>(key: string | Record<string, any>, options?: ValyncOptions<T>): [AsyncValue<T>, () => void, (updater: (prev: T | null) => T) => void];
//# sourceMappingURL=index.d.ts.map