feat: Add emitForEach / emitOnEach Methods (or something similar) to Cubit
Open
enhancement
feedback wanted
pkg:bloc
- Dominant language
- Dart
- Stars
- 12.5k
- Forks
- 3.4k
- PR merge metrics
- No merged PRs in 30d
Description
**Description**
When working with a `Cubit` that consume some other `Stream` you need to maintain a `StreamSubscription` during the life of the `Cubit` and close it etc. This comes with some extra work which is handled well in `Bloc` via `emit.forEach` / `emit.onEach` but no similar solution exists for that when using `Cubit`.
**Desired Solution**
Adding the methods `emitForEach` and `emitOnEach` with same signatures and functionality as their counter part in `Emitter`.
**Alternatives Considered**
Maybe give a `Cubit` its own `Emitter`.
Contributor guide
Assessment
This issue has not been assessed yet.