getStream method
Get the ValueStreamController for id
. If no ValueStreamController
exists for id
, a new one is created.
Implementation
Stream<T> getStream(
K id, {
T? initialValue,
bool initiallyNull = false,
}) {
final controller = _controllers[id] ??= ValueStreamController<T>(
initialValue: initialValue,
initiallyNull: initiallyNull,
);
controller.onCancel = () {
_controllers.remove(id);
};
return controller.stream;
}