import { FlowSubject } from '../FlowSubject.js'; import type { Action, Reducer, ReducerWithInitialState } from '../types/index.js'; /** * React hook that creates and memoises a {@link FlowSubject} from a reducer and * an initial state. The subject is created once and persists for the lifetime * of the component. * * @template S - The state type. * @template A - The action type. * @param reducer - A reducer function. * @param initial - The initial state value. * @returns A stable `FlowSubject` instance. * * @example * ```tsx * const subject = useObservable(myReducer, { count: 0 }); * subject.next({ type: 'increment' }); * ``` */ export declare function useObservable(reducer: Reducer, initial: S): FlowSubject; /** * React hook overload that accepts a reducer with a built-in initial state. * * @template S - The state type. * @template A - The action type. * @param reducer - A `ReducerWithInitialState` (e.g., created by `createReducer`). * @returns A stable `FlowSubject` instance. */ export declare function useObservable(reducer: ReducerWithInitialState): FlowSubject;