JavaScript的switch支持下通: function update(action, model) {
switch (action) {
case SHUFFLE:
return shuffle(model);
case MOVE_LEFT:
case MOVE_RIGHT:
case MOVE_UP:
case
考慮這個程序: import Graphics.Element exposing (..)
import Debug
main : Element
main =
let
one = Debug.log "one" 1
two = Debug.log "two" 2
three = Debug.log "three" 3
in
s
雖然elm-make成功,我得到以下錯誤在瀏覽器中:未定義 無法讀取屬性「孩子」我想這是因爲我有信號循環依賴: model -> clicks -> model
下面是相關代碼: model : Signal Model
model =
Signal.foldp update initialModel clicks
clicks : Signal Action
clicks