今天就学习课程吧!
今天就开通帐号,24,700 门业界名师课程任您挑!
Command pattern
- [Instructor] The command pattern is one that encapsulates actions or operations as objects. So in other words, in this pattern you abstract the actual function or execution of the action from the action itself. And if this sounds a bit weird, it is best represented through code. But if you have been using Redux for any amount of time you've used the command pattern. Which is where we use it by extracting the actions, which are called from the execution of the actions, which are reducers. It is also often used in functional programing. So let me show you through code on the Redux website. So go to Redux.js.org and go in the Getting Started section. And then scroll to the Basic Tutorial, click on it, and then find the Example Todo List. So this is a good example of a program or todo list, where we can actually see reducers, actions, and the container components in action, or the command pattern. So basically, you have the…
随堂练习,边学边练
下载课堂讲义。学练结合,紧跟进度,轻松巩固知识。
内容
-
-
-
-
-
-
(已锁定)
What are behavioral patterns?1 分钟 4 秒
-
(已锁定)
Observer pattern2 分钟 36 秒
-
(已锁定)
State pattern3 分钟 6 秒
-
(已锁定)
Chain of responsibility1 分钟 30 秒
-
(已锁定)
Iterator pattern3 分钟 44 秒
-
(已锁定)
Strategy pattern1 分钟 36 秒
-
(已锁定)
Memento pattern53 秒
-
(已锁定)
Mediator pattern1 分钟 32 秒
-
(已锁定)
Command pattern2 分钟 24 秒
-
(已锁定)
-