import { Epic } from 'redux-observable'; /** * EpicManager runs a permanent epic alongside a swappable one, so feature * epics can be code-split without putting bootstrap requests at risk. * * How it works: * 1. The `rootEpic` is passed to `epicMiddleware.run()` at store creation. * 2. The permanent epic (core epics) subscribes immediately and stays * subscribed for the lifetime of the store. * 3. After first paint the full feature epic module is dynamically imported * and injected via `setFeatureEpic()`, which merges into the same output. * * The feature slot uses `switchMap`, so replacing it unsubscribes the previous * feature epic — but the permanent epic is outside that slot and is never torn * down. That ordering guarantee matters: `fetch` is promise-based, so * unsubscribing an in-flight request does not cancel it. A cancelled core * subscription would let a successful response arrive with no subscriber left * to reduce it, pinning `fetchState` at `In-Progress` forever. * * The permanent epic must therefore contain everything the app needs before * the feature bundle resolves, and the injected feature epic must NOT repeat * those epics — see `featureRootEpic` in `epic.ts`. */ export interface EpicManager { /** The root epic to pass to epicMiddleware.run(). */ rootEpic: Epic; /** Replace the swappable feature epic (switchMap semantics). */ setFeatureEpic: (epic: Epic) => void; } export declare function createEpicManager(permanentEpic: Epic): EpicManager;