In this video Emmanuel Henri explains the mixins pattern with an example.
- [Narrator] Mixins are a great way…to mix functions and instances of a class…after they have been created.…In other words,…you could use Mixins…to add interesting functions…to the car class we created earlier.…So let me demonstrate.…So I just switched back to the code…where we see classes.…So the simple index.html and the index.js.…So if you're still in an old server,…just do a control+c to shut it down…and you should see that the server is done.…
And then click on the go live again…to get your old server back if you call it old server.…So now we got this,…let's bring up our developer tools,…so Shift + Control + I for Windows folks…and Option + Command + I for Mac.…So now we got our car back so we're back here.…Alright, perfect.…So what I'm going to do is create a mixins…with the code that we already have here.…So what we'll do is, just for the sake of cleanliness,…I'm going to remove the Suv stuff here…or just simply comment it out.…
I'm going to remove it just to make sure…that I don't confuse all the code that we have in here.…
- 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.