In this video Emmanuel Henri explains the state pattern with an example.
- [Instructor] The state pattern…has become popular with React's usage,…and now most web development frameworks use it.…Basically the state pattern is one…were we hold the state of the application…with all the data and properties needed,…sometimes called props, in React.…And when it changes,…it updates the rendering of the application.…And again, needless to say, React, Angular,…and every state management library…are a great example of its use.…So let's take a look again at the React application…we have in our resources, and look inside the app.js file.…
Or look at the corresponding exercise files…inside of this chapter.…And then look at app.js here.…And as we can see here,…we are declaring a state inside of a class.…So, and again, all of React's components…are declared as classes,…and it extends the component class…that is defined in React's library.…And then we're passing a constructor with props,…which we're leveraging again…from the library in the component.…
And then we're declaring our state.…So this is basically our state that we need…
- 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.