debugAttachStateEngine function
void Function()
debugAttachStateEngine()
Sends the state.* events of the stores registered from now on, and of those already, to emit, as if a
Capybara server were connected: for the tests of adapter packages. The function returned stops it.
Implementation
@visibleForTesting
void Function() debugAttachStateEngine(void Function(String kind, Map<String, Object?> payload) emit) {
final engine = StateEngine((kind, payload, {ts}) => emit(kind, payload), connected: () => true);
StateRegistry.instance.attach(engine);
return () {
StateRegistry.instance.detach(engine);
engine.dispose();
};
}