Would it be beneficial to add support for on fetch (or state change) event handlers since useEffect can be delayed or not run at all?
Example,
const info = useQuery('todos', fetchTodoList, { onError: (error) => showToast(error) });
const [mutate, { data, isLoading, error }] = useMutation(login, { onSuccess: (data) => reduxDispatch({type: 'LOAD_PROFILE', data: data }) });
On the last example, we can probably handle this in the event that made the call to mutate:
const data = await mutate({ title })
reduxDispatch({type: 'LOAD_PROFILE', payload: data });
The onError and related useQuery event handlers should be pretty easy to do. The mutate handler, I agree that it's simple enough just to rely on the promise of the
mutatefunction. I think it's better control flow there tbh.