Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

docs: add comment to optimistic update

Marc Klingend209766f01de
diff --git a/src/components/star-toggle.tsx b/src/components/star-toggle.tsx
index 4382d2717d..2a0d419bbb 100644
--- a/src/components/star-toggle.tsx
+++ b/src/components/star-toggle.tsx
@@ -57,6 +57,9 @@ export function StarTraceToggle({
const [isLoading, setIsLoading] = useState(false);
const mutBookmarkTrace = api.traces.bookmark.useMutation({
+ // Optimistic update
+ // Tanstack docs: https://tanstack.com/query/v4/docs/react/guides/optimistic-updates
+
onMutate: async () => {
// Cancel any outgoing refetches
// (so they don't overwrite our optimistic update)