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

Chapter 2Create Stateful Elm Applications

In the previous chapter, you learned how to define Elm functions and build the static Picshare application with the Html module. Most applications aren’t going to be so simple, however. In this chapter, we’ll introduce state to the Picshare application. State is important for creating interactive applications. For the Picshare application, you will add the ability to “like” photos. To do this, you will need application state to track if a photo is liked.

You’ll learn how to use the Elm Architecture to create a model for application state, a view function for displaying the model, and an update function for making changes to the model. Along the way, you’ll learn about records, custom types, and immutability—all ...

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