O'Reilly logo

Programming Elm by Jeremy Fairbank

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

What You Learned

And…that’s a wrap. You achieved a lot in this chapter. You parsed static and dynamic URL paths with the Url.Parser module. Then, you used the Browser.application function along with the Elm Architecture to access the browser’s current URL and convert it into a route and page. You built components and updated their state through the Elm Architecture. Finally, you used your components to display different pages depending on the current page state.

The duplication code smell still remains in setNewPage and update. Wiring up each component leads to extremely similar code. As a challenge, create a helper function that sets the model’s page field with the appropriate Page constructor and page component model, and maps the command ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required