JController<T extends JState> constructor
- T initialState, {
- JIntentDispatcher? dispatcher,
- int effectBufferSize = 0,
Creates a new JController with the given initial state.
Calls onInit synchronously from this base constructor. Overrides must not rely on fields initialized later by a subclass constructor body.
By default effects emitted while nobody listens to sideEffects are
dropped (fire-and-forget) or failed (awaitable). Set effectBufferSize to
a positive value to retain up to that many effects until a listener
attaches; see emitSideEffect.
Implementation
JController(
super.initialState, {
JIntentDispatcher? dispatcher,
int effectBufferSize = 0,
}) : assert(effectBufferSize >= 0, 'effectBufferSize must not be negative'),
_dispatcher = dispatcher ?? JSequentialIntentDispatcher(),
_effectBufferSize = effectBufferSize {
onInit();
}