Chapter 4Interacting with Web Pages
Interacting with web pages is a key requirement of web development. In this chapter, we’ll move beyond writing output to the terminal window and examine how ReasonML lets you get input from and display output to a web page as part of building web applications.
This means that things are going to get messy, and we’re going to have to handle a non-ideal world. We might attempt to access an element that isn’t in the HTML page. A user-entered string that should convert to an integer might not—if two is entered instead of 2, for example. In each of these cases, we get an option value as we discussed. This is where we’ll put the Belt.Option library that we saw to work to handle a chain of operations, all yielding ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access