Query & Mutation Builders now doesn't create a new instance

This commit is contained in:
Kingkor Roy Tirtho
2022-07-12 03:15:44 +06:00
parent 89272d5c00
commit 88841e71f8
10 changed files with 40 additions and 27 deletions
@@ -27,7 +27,7 @@ Mutation<T, V> useMutation<T extends Object, V>({
final init = useCallback(() {
mutation.value = queryBowl.addMutation<T, V>(
mutation.value,
job,
onData: onData,
onError: onError,
onMutate: onMutate,
@@ -55,10 +55,6 @@ Mutation<T, V> useMutation<T extends Object, V>({
useEffect(() {
if (oldJob != null && oldJob.mutationKey != job.mutationKey) {
disposeMutation();
mutation.value = Mutation<T, V>.fromOptions(
job,
queryBowl: queryBowl,
);
init();
} else {
if (oldOnData != onData && oldOnData != null) {