@zedux/core
Version:
A high-level, declarative, composable form of Redux
12 lines (9 loc) • 556 B
TypeScript
import { ActionFactory } from '../types.js';
/**
Factory for creating ActionFactory objects.
ActionFactories are just action creators with an extra `.type` property set to
the string passed to `actionFactory()`.
ActionFactories can be passed directly to a ReducerBuilder's `reduce()`
method, thus removing the necessity of string constants.
*/
export declare const actionFactory: <Payload = undefined, Type extends string = string>(actionType: Type) => Payload extends undefined ? ActionFactory<undefined, Type> : ActionFactory<Payload, Type>;