In this video Emmanuel Henri explains the command pattern with an example.
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've been using Redux for any amount of time,…you've used a command pattern,…which is where we use it by abstracting the actions,…which are called from the execution of the actions,…which are reducers.…It is also often used in functional programming.…
So, if you go to Redux.js.org,…and then click on the basics section,…and then click on the example to-do list.…Then scroll down 'til you see the action creators.…So, basically, what we do in Redux,…we are creating actions here,…and then the reducers, basically, executes the actions.…So, once we actually call the action from an event,…then it goes through that file here…and then it goes through,…okay, so we are creating this action.…
We have an add to-do; we have a set visibility filter;…we have a toggle to-do, and then show all,…
- What's a pattern?
- What's the role of callbacks?
- Creational patterns, including Singleton and Factory
- Structural patterns, including model-view-controller
- Behavioral patterns, including Memento and Mediator
Skill Level Intermediate
2. Creational Patterns
3. Structural Patterns
4. Behavioral Patterns
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.