From the course: JavaScript: Patterns

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

State pattern

State pattern - JavaScript Tutorial

From the course: JavaScript: Patterns

Start my 1-month free trial

State pattern

- [Instructor] The state pattern has become very popular with React's usage, and now most web development frameworks use it, basically the state pattern is one where we hold the state of the application with all the data and properties needed and when it changes it updates a rendering of the application, and again needless to say, React and Angular, and every state management library are great examples of its use, let's take a look at the React application we have in our exercise files. So if you look into the exercise files, under chapter four and then video04_03, you have a React application with several components and state management in here, so let's open that in Visual Studio Code, so I'm going to drag and drop that folder inside of Visual Studio Code, and let's take a look at the application. So basically if we look at the app.js file here, you have a state right here, in your constructor, we are setting our…

Contents