weixin_39626131
weixin_39626131
2020-12-26 10:24

Conditional Behavior

Keeps coming up over and over again. Want a quick way to decorate an existing Behavior with a conditional "run the inner behavior if this condition is met, but pass into the next behavior as normal regardless"

Needs more conversation.

该提问来源于开源项目:DarthFubuMVC/fubumvc

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

5条回答

  • weixin_39747511 weixin_39747511 4月前

    Interesting. Maybe delegate to a strategy and provide a lambda implementation for the DSL? Give a clean and simple predicate through the DSL or enable DI-enabled scenarios for evaluating the condition.

    点赞 评论 复制链接分享
  • weixin_39793319 weixin_39793319 4月前

    Josh, I think that delegation idea to a strategy with DSL sounds like powerful tool :) Do you have some example of how you would use this?

    点赞 评论 复制链接分享
  • weixin_39747511 weixin_39747511 4月前

    I think Josh's original variable output node example is a great use case. To be fair, I can't think of a good lambda use case, though...

    点赞 评论 复制链接分享
  • weixin_39793319 weixin_39793319 4月前

    Aah! I did not see that one :)

    Hopefully this could be used to do some state machine / guard stuff as well.

    点赞 评论 复制链接分享
  • weixin_39626131 weixin_39626131 4月前

    This was pushed in a couple weeks ago

    点赞 评论 复制链接分享

相关推荐