fluffychat/lib/pangea/common/controllers/base_controller.dart
ggurdin 027158e286
1435 refactor into function specific groupings (#1440)
* fix: deleted unreferenced files

* fix: sort files based on function
2025-01-14 14:00:30 -05:00

18 lines
338 B
Dart

import 'dart:async';
class BaseController<T> {
final StreamController<T> _stateListener = StreamController<T>();
late Stream<T> stateStream;
BaseController() {
stateStream = _stateListener.stream.asBroadcastStream();
}
dispose() {
_stateListener.close();
}
setState(T data) {
_stateListener.add(data);
}
}