@spartacus/core
Version:
Spartacus - the core framework
12 lines (11 loc) • 609 B
TypeScript
import { Action } from '@ngrx/store';
import { LoaderState } from './loader-state';
import { LoaderAction } from './loader.action';
export declare const initialLoaderState: LoaderState<any>;
/**
* Higher order reducer that adds generic loading flag to chunk of the state
*
* Utilizes "loader" meta field of actions to set specific flags for specific
* action (LOAD, SUCCESS, FAIL, RESET)
*/
export declare function loaderReducer<T, V extends Action = Action>(entityType: string, reducer?: (state: T, action: Action | V) => T): (state: LoaderState<T> | undefined, action: LoaderAction) => LoaderState<T>;