二极管。在电路中发送超过1个动作

问题描述 投票:1回答:2

同事,我不能让diode,从另一个动作发送自己不止一个动作。这里来自App circuit的例子:

val handler = new ActionHandler(myZoomedState) {
    override def handle = {
      case action => effectOnly(Effect(someFuture map {_ =>
        someAction  //This action doesn't perform 
        someOtherAction  //This one does
      }))

      case someAction => ???
      case someOtherAction => ???
    }
}

如何连锁我的行动?像qazxsw poi和qazxsw poi这样的东西: qazxsw poi

scala frontend scala.js diode
2个回答
0
投票

奥列格,你的问题还不太清楚。如果你的>>callbacks的处理程序实际上只是作为你的someCallback >> someOtherCallback的实现建议,你可以将它们移动到命名方法并使用someAction组合它们。如果这不是您想要的,您应该详细说明您的问题。


0
投票

解决方案是创建另一个动作,结合这两个动作。我仍然可以处理someOtherAction错误。看起来像这样:

case action
© www.soinside.com 2019 - 2024. All rights reserved.