Here’s my first real use of ports in an Elm application. It’ll be light on the commentary, heavy on code.
On the Elm side of things, the application will provide the bare minimum components to display the results of these calls via the ports mechanism to the user.
Note that I use the following packages/tools in this project:
The application can be run by typing
make at the command line:
You’ll need to create your
google-api-client-id.txt file by grabbing your Google API client ID after consulting the following resources:
This file is typically updated using the
<body>element where Elm application is rendered
"use strict";because you should always do this!
messagefield for displaying error messages to the user
AuthStateChangedis fired whenever the user signs in or out
SignInClickedis triggered when the user clicks the sign-in button
SignOutClickedis triggered when the user clicks the sign-out button
updatefunction for updating the state of the app
Check out the full project here.
Content © 2023 Richard Cook. All rights reserved.