What problem does it solve?
This Skill enables developers to implement and configure observers for AsyncRedux stores to monitor actions, state changes, errors, and widget rebuilds.
Core Features & Use Cases
- ActionObserver: Monitor action dispatch (start and end) to track lifecycle and performance.
- StateObserver: Track state changes after reducers to detect changes and history.
- ErrorObserver: Capture, log, and optionally control error propagation during action execution.
- ModelObserver: Observe widget rebuilds when using StoreConnector to optimize UI performance.
- Use together with GlobalWrapError to centralize error handling and with multiple observers to compose analytics and debugging workflows.
Quick Start
Create your observers (e.g., ConsoleActionObserver, MyStateObserver, MyErrorObserver, DefaultModelObserver) and wire them into your Store:
var store = Store<AppState>(
initialState: AppState.initialState(),
actionObservers: [ConsoleActionObserver()],
stateObservers: [MyStateObserver()],
errorObserver: MyErrorObserver(),
modelObserver: DefaultModelObserver(),
);