trigger an Action from the Update function

后端 未结 1 1884
刺人心
刺人心 2021-01-28 00:20

Got a hopefully simple problem. When I receive action A in my update function, I\'d like to return a task that does some stuff, then results in action B, which is received by t

1条回答
  •  臣服心动
    2021-01-28 01:07

    StartApp requires a port for tasks in addition to main. Change your main function and add the tasks port like this and you'll be all set:

    app =
      start
        { init = init
        , update = update
        , view = view
        , inputs = []
        }
    
    main =
      app.html
    
    port tasks : Signal (Task.Task Effects.Never ())
    port tasks =
      app.tasks
    

    0 讨论(0)
提交回复
热议问题