对比vuex与redux
同:
两者都是处理全局状态的工具库,大致实现思想都是:全局state保存状态---->dispatch(action)
------>reducer(vuex里的mutation)----> 生成newState;
异:
vuex调用mutation使用commit
redux调用reducer使用dispatch
同:
两者都是处理全局状态的工具库,大致实现思想都是:全局state保存状态---->dispatch(action)
------>reducer(vuex里的mutation)----> 生成newState;
异:
vuex调用mutation使用commit
redux调用reducer使用dispatch