provider lifecycle hardenings

This commit is contained in:
Fabian Freund
2026-05-06 18:32:45 +02:00
parent d5f977a3d2
commit fee15cb8d2
25 changed files with 246 additions and 94 deletions
@@ -31,11 +31,9 @@ part 'providers.g.dart';
@Riverpod(keepAlive: true)
Future<KagiSourceService> kagiSourceService(Ref ref) async {
final db = ref.watch(smallWebDatabaseProvider);
final categories = await ref.watch(kagiCategoriesProvider.future);
return KagiSourceService(
ref.watch(smallWebDatabaseProvider),
categories.remap,
);
return KagiSourceService(db, categories.remap);
}
@Riverpod(keepAlive: true)
@@ -45,13 +43,11 @@ WanderSourceService wanderSourceService(Ref ref) {
@Riverpod(keepAlive: true)
Future<SmallWebDiscoverService> smallWebDiscoverService(Ref ref) async {
final db = ref.watch(smallWebDatabaseProvider);
final wanderService = ref.watch(wanderSourceServiceProvider);
final kagiService = await ref.watch(kagiSourceServiceProvider.future);
return SmallWebDiscoverService(
ref.watch(smallWebDatabaseProvider),
kagiService,
ref.watch(wanderSourceServiceProvider),
);
return SmallWebDiscoverService(db, kagiService, wanderService);
}
@Riverpod()