建议使用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();
}