Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Yet another side effect layer for Redux

Sponsored · Ship Features Fearlessly Turn features on and off without deploys. Used by thousands of Ruby developers.

Yet another side effect layer for Redux

Avatar for Daisuke Mino

Daisuke Mino

April 24, 2018
Tweet

More Decks by Daisuke Mino

Other Decks in Programming

Transcript

  1. ͜Μͳ͔Μ͡ 1 fork('ORDER', async (action, dispatch) => {¬ 2 dispatch({

    type: 'USER_FETCH', action.payload.userID })¬ 3 const { payload } = await merge('USER_FETCHED')¬ 4 const resp = await fetch(`/api/orders`, {¬ 5 method: 'POST',¬ 6 body: JSON.stringify({ productID: action.payload.productID }),¬ 7 })¬ 8 dispatch({ type: 'ORDERED', payload: JSON.parse(resp.body) })¬ 9 })