Optimistic updates for endpoints
Yes but this is for mutations and queries, for example if I make a request to an endpoint in convex how do I handle an optimistic update. There’s no way to access the local cache.
const [aiMessageInFlight, setAiMessageInFlight] = useState(false);
const serverMessages = useQuery(api.messages.list, {});
const messages = useMemo(() => [...serverMessages, {body: 'hello'}], [serverMessages, aiMessageInFlight]);