Check out a free preview of the full Advanced Elm course

The "Scaling Exercise" Lesson is part of the full, Advanced Elm course featured in this preview video. Here's what you'd learn in this lesson:

Students are instructed to refactor three different files to accept narrower types than the entire Model.

Preview
Close

Transcript from the "Scaling Exercise" Lesson

[00:00:00]
>> Richard Feldman: Let's move on to the exercise.
>> Richard Feldman: All right part4.
>> Richard Feldman: All right so about README and talks about TODOs in three files. So we have three different files that are each over overly broad, they're not narrow enough in terms of how they could be with the types that they're working with.

[00:00:34]
>> Richard Feldman: So the first one is viewTabs. Assistively it's only working with tabs and yet it's taking the entire model which means any time we're thinking about making a change to the model we say yeah, that change could potentially impact viewTabs So we're going to need to change it so that it takes a narrower, more specific type that gives it sort of only what it needs.

[00:00:53]
On the settings page, we have a similar situation. This form again, is taking the entire model, it does not need to be. And finally, on the profile page In this case, we have something that is also sort of of the same, it has the same problem where it's taking the model and it doesn't need to be, but it also has additional arguments that give it something more specific.

Learn Straight from the Experts Who Shape the Modern Web

  • In-depth Courses
  • Industry Leading Experts
  • Learning Paths
  • Live Interactive Workshops
Get Unlimited Access Now