import { BuilderFunction, Reducer } from '../types'; import { ActorEvent } from '../types/actor-event.type'; /** * Utility function to create reducers * @param initialState reducer initial state * @param builderFunction a function that takes an instance of `ReducerBuilder` as parameter to generate the reducer * @returns a reducer function * @example * * import { createEvent, createReducer } from 'reactive-actor'; * * export interface LayoutState { * loading: boolean; * error: string; * } * * export const layoutInitialState: LayoutState = { * loading: false, * error: '', * }; * * export const startLoader = createEvent('START_LOADER'); * * export const stopLoader = createEvent('STOP_LOADER'); * * export const layoutReducer = createReducer(layoutInitialState, (builder) => * builder * .addCase(startLoader, (state) => ({ ...state, loading: true })) * .addCase(stopLoader, (state) => ({ ...state, loading: false })) * ); * */ export declare function createReducer(initialState: TState, builderFunction: BuilderFunction): Reducer;