Last active
May 24, 2019 13:51
-
-
Save jhrcek/1cebd19480e574a49230a310242ad20b to your computer and use it in GitHub Desktop.
Are requests sent, when `Cmd.map (always NoOp) requestCmd`?
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
| module Main exposing (main) | |
| import Browser | |
| import Html exposing (Html) | |
| import Http | |
| type Msg | |
| = GotText (Result Http.Error String) | |
| | NoOp | |
| getPublicOpinion : Cmd Msg | |
| getPublicOpinion = | |
| Http.get | |
| { url = "https://elm-lang.org/assets/public-opinion.txt" | |
| , expect = Http.expectString GotText | |
| } | |
| main : Program () () Msg | |
| main = | |
| Browser.element | |
| { init = init | |
| , view = view | |
| , update = update | |
| , subscriptions = always Sub.none | |
| } | |
| init : () -> ( (), Cmd Msg ) | |
| init _ = | |
| ( (), Cmd.map (always NoOp) getPublicOpinion ) | |
| update : Msg -> () -> ( (), Cmd Msg ) | |
| update msg model = | |
| ( model, Cmd.none ) | |
| view : () -> Html Msg | |
| view () = | |
| Html.text "" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment