我试图获得User
与Projects
. 这是我的models/user.js
*fetchUser({ payload, callback }, { call, put }) {
const user = yield call(queryUser, payload);
yield put({
type: 'setCurrentUser',
payload: user,
});
if (callback) callback();
},
最佳做法是什么?我应该在哪里调用该函数queryProjects
?也许在这条线以下?
const user = yield call(queryUser, payload);
const projects = yield call(queryProjects, user); // new api call