@equinor/fusion-query
Version:
Reactive data fetching and caching library with observable streams and comprehensive event system
10 lines (9 loc) • 620 B
TypeScript
import type { QueryCacheStateData } from './types';
import type { ActionBuilder, Actions } from './actions';
/**
* Creates a reducer for managing the state of a query cache.
* @param actions An object containing action creators for the cache.
* @param initial The initial state data of the query cache.
* @returns A reducer function tailored for the query cache state.
*/
export default function <TType, TArgs>(actions: ActionBuilder<TType, TArgs>, initial?: QueryCacheStateData<TType, TArgs>): import("@equinor/fusion-observable").ReducerWithInitialState<QueryCacheStateData<TType, TArgs>, Actions<TType, TArgs>>;