An Elm Primer for React Developers
/
Part II: The Outside World: Randomness, APIs, and JavaScript
Part II: The Outside World: Randomness, APIs, and JavaScript
https://leanpub.com/elm-for-react-devs
Up next
Chapter 5: Commands and Randomness
In this part
Chapter 5: Commands and Randomness
Upgrading from Browser.sandbox to Browser.element
The Cmd Type and How It Works
Adding Randomness to the LGTM Generator
What You Just Learned
Chapter 6: HTTP and Remote Data
From Random.generate to Http.get
Setting Up the Server
Installing elm/http
The Shape of HTTP in Elm
Success | Loading | Error
Creating the HTTP Request
Updating init
Refactoring the GotPhrase Message
Handling Results in update
Rendering Different States
The Complete Code
Commands Are Just Commands
What You Just Learned
Chapter 7: JSON Decoders and Type Safety
Why JSON Needs Decoding in Elm
Supporting JSON in Our LGTM Generator
What About Sending JSON?
What You Just Learned
Further Reading
Chapter 8: JavaScript Interop: Ports and Flags
JavaScript as Infrastructure
Upgrading Our Build for Manual Bootstrapping
Flags as Program Input
Ports for Communicating with JavaScript
Adding Clipboard Support to the LGTM Generator
What You Just Learned