Skip to content

Latest commit

 

History

History
33 lines (23 loc) · 708 Bytes

File metadata and controls

33 lines (23 loc) · 708 Bytes

This page covers Elm 0.18

メイン

メインのモデル

__src/Models.elm__のハードコーディングされたプレイヤーのリストを削除します。

initialModel : Model
initialModel =
    { players = []
    }

メイン

最後に、アプリケーションを起動するときに fetchAllを実行します。

__src/Main.elm__を以下のように修正します:

...
import Messages exposing (Msg(..))
...
import Players.Commands exposing (fetchAll)

init : ( Model, Cmd Msg )
init =
    ( initialModel, Cmd.map PlayersMsg fetchAll )

これで initはアプリケーションの起動時に実行するコマンドのリストを返します。