Redux: Using async middlewares vs dispatching actions on success functions
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I am trying to integrate Redux into my React project. Currently I'm not using any Flux framework. My app gets some data from the API and displays it in a pretty way, like so: componentDidMount () { getData (); } getData () { const self = this ; ajax ({ url : apiUrl , }) . success ( function ( data ) { self . setState ({ data : data , }); }) . error ( function () { throw new Error ( 'Server response failed.' ); }); } In reading about Redux, I've settled on two possible approaches that I could use for handling storing my success data