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 ...

Get Programming Elm now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.