refactored chat data fetching to support separate cache and network callbacks
This commit is contained in:
@@ -5,7 +5,8 @@ import 'get_chat_response.dart';
|
||||
|
||||
class GetChatCache extends SimpleCache<GetChatResponse> {
|
||||
GetChatCache({
|
||||
required void Function(GetChatResponse) onUpdate,
|
||||
super.onCacheData,
|
||||
super.onNetworkData,
|
||||
super.onError,
|
||||
required String chatToken,
|
||||
}) : super(
|
||||
@@ -19,7 +20,6 @@ class GetChatCache extends SimpleCache<GetChatResponse> {
|
||||
),
|
||||
).run(),
|
||||
fromJson: GetChatResponse.fromJson,
|
||||
onUpdate: onUpdate,
|
||||
) {
|
||||
start('nc-chat-$chatToken');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user