dispose method
Disposes of resources managed by the wrapper.
- Processes any disposableEffects of type
E. - Disposes the handler if it implements Disposable.
- Cancels the subscription to the effects stream.
Implementation
@override
Future<void> dispose() async {
for (final effect in disposableEffects) {
if (effect is E) {
await handler(effect, accept);
}
}
if (handler is Disposable) {
await (handler as Disposable).dispose();
}
await _subscription?.cancel();
return feature.dispose();
}