omichelsen / redux-promise-middleware-actions

Redux action creator for making async actions compatible with redux-promise-middleware
MIT License
32 stars 3 forks source link

How to easily combine multiple actions? #7

Closed onweer closed 5 years ago

onweer commented 5 years ago

image

omichelsen commented 5 years ago

You could just put them into one:


export const doEverything = createAsyncAction(EVERYTHING, async (id, body) => {
  const a = await createUserInfo(body)
  const b = await getUserInfo()
  const c = await deleteUserInfo(id)
  return { a, b, c }
})