Created
December 9, 2016 12:52
-
-
Save lorenzo/8dd60878f2e36021f7d9335eea4ceee4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Elm.main.ports.requestAddOne.subscribe((a) => { | |
result = 1 + a; | |
Elm.main.ports.receiveAddOnce.send(result); | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
port module Main exposing (..) | |
port requestAddOne : Int -> Cmd Msg | |
port receiveAddOne : (Int -> Msg) -> Sub Msg | |
subscriptions model = Sub.batch [ receiveAddOnce GetAddOneResult] | |
update msg model = | |
(model, requestAddOne 1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment