export const getMenu = () => { return async (dispatch) => { let msg = await fetch('data/nodes',{ method: 'POST', //body: JSON.stringify({"aa":"aa"}), header: {'content-type':'application/json; charset=utf-8'} }).then((res)=>res.json()); var state = { nodes: msg }; dispatch({ type: 'INIT', state }); };}
react中用了async就不用redux-thunk這個插件了吧?
喵喵時(shí)光機(jī)
2018-10-17 17:18:07