在RTK查询中按顺序执行多个突变的推荐方法是什么



建议使用RTK查询以哪种方式按顺序执行多个突变?

const [
updateProfile, 
] = useUpdateProfileMutation();
const [
updatePost,
] = useUpdatePostMutation();

const performMutipleMuations = async () => {
const data= await updateProfile(newData);
await updatePost(data);
};

最终使用unwrap成功了。

const performMutipleMuations = async () => {
const data= await updateProfile(newData).unwrap();
await updatePost(data).unwrap();
}

最新更新