chore: more comment and 1 level deep BuildContext

This commit is contained in:
Kingkor Roy Tirtho
2023-06-10 12:12:49 +06:00
parent c6e484637a
commit 7dd9036e69
7 changed files with 53 additions and 41 deletions
@@ -17,6 +17,7 @@ Mutation<DataType, ErrorType, VariablesType>
List<String>? refreshInfiniteQueries,
List<Object?>? keys,
}) {
final mounted = useIsMounted();
final rebuild = useUpdater();
final client = useQueryClient();
final mutation =
@@ -42,7 +43,9 @@ Mutation<DataType, ErrorType, VariablesType>
useEffect(() {
if (onMutate != null) {
return mutation.mutationStream.listen((event) async {
recoveryData.value = await onMutate.call(event);
if (mounted()) {
recoveryData.value = await onMutate.call(event);
}
}).cancel;
}
return null;