diff --git a/readme.md b/readme.md index a7fd56e5a5ed368d57745c4977579763e21da200..0abb4aca616540990fe6954c0ee1fa42964fd059 100644 --- a/readme.md +++ b/readme.md @@ -87,6 +87,7 @@ const mutDeleteItem = mutations.define({ // `optimistic` is provided a `helpers` object which implement automatic rollbacks. optimistic({ client, get, helpers, args: [id], onSuccess, onRestore, onRefetch }) { // Remove the items matching the filter, but restore and refetch them on failure. + // On success, the default behavior is to also re-fetch queries. helpers.arrayRemove(queryItemList, (item) => item === id); // Set a property on an object, also restores and refetches. The `obj` // helpers implement a type-safe object path system for nested fields. @@ -115,8 +116,8 @@ const mutDeleteItem = mutations.define({ // Example: `Successfully {description}` describeResult: ({ get, args: [id] }) => "Deleted Item", - // Since the optimistic handler is perfect, there is no need to refetch any - // data once a success case is hit. This defaults to false for simplicity. + // Since this optimistic handler above is perfect, we can decide to disable + // success-based refetching. This is default so that more things just work. refetchOnSuccess: false, });