StreamEventListener<T> constructor
StreamEventListener<T> (
- String? type, {
- EventCallback<
T> ? callback, - bool once = false,
- bool protected = false,
- EventCallbackAdd<
T> ? onAdd, - EventCallbackRemove<
T> ? onRemove, - EventCallbackCall<
T> ? onCall, - EventCallbackCancel<
T> ? onCancel, - bool cancelAdded = true,
Implementation
StreamEventListener(
String? type, {
EventCallback<T>? callback,
super.once,
super.protected,
super.onAdd,
super.onRemove,
super.onCall,
super.onCancel,
super.cancelAdded,
}) : super(type, callback ?? (T data) {}) {
appendCallback(
onRemove: (emitter) => close(),
onCall: (data) => _controller.add(data),
);
}