0
我想做一些非常不起作用的東西,並在elm中做一個HTTP請求而不處理任何類型的響應。基本上是這樣的:HTTP請求沒有請求在Elm 0.18
testView : Html Msg
testView =
div [] [
button [onClick TestAction] [text "Test Action"]
]
update : Msg -> Model -> (Model, Cmd Msg)
update msg model =
case msg of
...
TestAction ->
(model, testActionCmd)
...
import Http
import HttpBuilder exposing (..)
...
testActionCmd : Cmd Msg
testActionCmd =
("http://localhost:4000/fakeurl")
|> get -- this is a side effect; unrelated to the Msg below
Cmd.none -- this is what I want to return
有沒有辦法做這樣的事情在榆樹?