mirror of
https://github.com/KRTirtho/spotube.git
synced 2026-02-03 23:52:52 +00:00
15 lines
339 B
Dart
15 lines
339 B
Dart
import 'package:riverpod/riverpod.dart';
|
|
import 'package:spotube/provider/server/libs/eventsource_publisher.dart';
|
|
|
|
final ssePublisherProvider = Provider<EventSourcePublisher>(
|
|
(ref) {
|
|
final publisher = EventSourcePublisher(cacheCapacity: 100);
|
|
|
|
ref.onDispose(() {
|
|
publisher.close();
|
|
});
|
|
|
|
return publisher;
|
|
},
|
|
);
|