Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jlengrand/elm-ports
A simple demonstration on how to work with Elm Flags and Ports
https://github.com/jlengrand/elm-ports
elm-architecture elm-demos elm-lang elm-language elm-ports
Last synced: 24 days ago
JSON representation
A simple demonstration on how to work with Elm Flags and Ports
- Host: GitHub
- URL: https://github.com/jlengrand/elm-ports
- Owner: jlengrand
- Created: 2019-07-28T13:59:23.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-10T23:56:30.000Z (almost 2 years ago)
- Last Synced: 2024-09-30T05:22:20.821Z (about 1 month ago)
- Topics: elm-architecture, elm-demos, elm-lang, elm-language, elm-ports
- Language: JavaScript
- Homepage: https://elm-ports.netlify.com/
- Size: 1.79 MB
- Stars: 6
- Watchers: 3
- Forks: 2
- Open Issues: 17
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Elm Ports and Flags
This repository is a simple [Elm](https://elm-lang.org) (0.19) minimal app making use of Flags and Ports to communicate with Javascript.
The repository is composed of 3 main things to see :
- The `sendStuff` port, which will send some test data to Javascript every time you press the button
- The `receiveStuff` port, which will periodically receive data from Javascript. It is javascript that triggers the port, and Elm will update its model every time it receives data.
- The `Flags` type alias, that is setup and is used by the `init` function to grab data from Javascript before the model is even generated.**You can read the complete write-up about this example [here](https://lengrand.fr/a-short-introduction-to-ports-and-flags-in-elm)** and **[see a running example here](https://elm-ports.netlify.com/)**.