我有几个这样的 RSAA 动作:
export const getUserById = id => ({
[RSAA]: {
endpoint: "...",
method: "GET",
headers: { "Content-Type": "application/json" },
credentials: "include",
types: [
GET_USER_BY_ID_REQUEST,
GET_USER_BY_ID_SUCCESS,
GET_USER_BY_ID_FAILURE
]
}
});
export const getUserPosts = id => ({
[RSAA]: {
endpoint: "...",
method: "GET",
headers: { "Content-Type": "application/json" },
credentials: "include",
types: [
GET_USER_POSTS_REQUEST,
GET_USER_POSTS_SUCCESS,
GET_USER_POSTS_FAILURE
]
}
});
我该怎么做才能使用 thunk (我认为)链接这两个动作?
我可以创建第三个名为getUserThenPosts
? 但那会是什么样子?