redux-devtools简介(redux开发必备)

作者: 熊师傅 | 来源:发表于2017-11-09 15:26 被阅读0次

今天跟大家聊一聊 redux 的调试工具,熊师傅介绍框架有一个原则,言简意赅,指望手把手送到嘴边的朋友请绕道,谢谢。但是有任何疑问,可以在下方留言,熊师傅看到都会解答,当然前提是经过思考和研究之后的问题。

最近发现一个问题,人随着年龄的增长,记忆力越来越差,但是理解东西的能力却在增长。不知道大家有没有这样的感受,很多半年或几个月前不理解而放弃的东西,如今回过头来一看,有一种恍然大悟的感觉。

引用方法:

devtools界面(有错误,下方纠正)

补充,纠错:

基于reset,revert,和sweep,commit特意去官网查了查

There are four buttons at the very top. “Reset” takes your app to the state you created the store with. The other three buttons work together. You might find it useful to think of them like you think of Git commits. “Commit” removes all actions in your log, and makes the current state your initial state. This is useful when you start working on a feature and want to remove the previous noise. After you’ve dispatched a few actions, you can press “Revert” to go back to the last committed state. Finally, if you dispatched some actions by mistake and you don’t want them around, you can toggle them by clicking on them, and press “Sweep” to completely remove all currently disabled actions from the log.

这里给大家翻译一下:

1.reset:  重置
2.revert: 在commit一个状态之后,恢复到上一次commit的状态(类似git)
3.sweep: 如果你某些action dispatch错误了之后,可以通过这个删掉
4.commit: 提交保存某一刻的状态

demo地址,建议亲自跑一跑 ^ . ^

相关文章

网友评论

    本文标题:redux-devtools简介(redux开发必备)

    本文链接:https://www.haomeiwen.com/subject/czopmxtx.html