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はアプリケーションの起動時に実行するコマンドのリストを返します。