This task focuses on the separation of concerns. Kyle wants each module to know as little as possible about the other modules. Using an event emitter library, Kyle demonstrates how to create a custom event to send information between modules.
(Oriental flute music)…- Just for the sake of keeping going along…the same lines of thinking that we had before,…I'm going to skip items one and two in task four,…I'll come back at the very end and do those quickly,…those are kind of some throwaway things for you to try.…But three and four are really…spot on to what we were just talking about.…I already showed you that…we could refactor to add an API method,…which was this loadPerson method, to our API.…
And then we could directly call it from inside…of the carousel function.…There's a couple of problems with that…when you start thinking at an even bigger level,…at an even higher level of abstractions.…We certainly improve things by doing that…compared to what we had before…but even this may not be the end goal…or the best possible design.…So this next line of thinking is an even…further stretch of your envelope, conceptually speaking.…
One of the things that we've done here…is that even though we have the two…actual pieces of logic separate,…we've created a very strong tie…
Note: This course was created on 03/29/2016 by Frontend Masters. We are pleased to host this content in our library.
- Carousels, panes, and modules
- Middle-end architecture
- Secure phrase generator
- Routing functions
- Calling the API
- Rendering on the page
- Shared data validation
Skill Level Intermediate
2. Organizing Code
5. Adding a Shared Module
- 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.