Reacting to a distant descendant workflow #326
-
Not sure if this forum is intended for usage questions, so forgive me if this is off-topic.. Just wondering if there's an idiomatic or intended way for a workflow to react to something that happens in a child of a child of a child (etc...) or vice-versa? Or is it left to the developer to hook some kind of eventbus/messaging system up to their workflows? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Thanks for the question.
But we do go for bus-like things sometimes, and in that case, yeah, you're on your own. For us the latter approach is usually less like a bus and more like a repository or other model object, injected via Dagger. |
Beta Was this translation helpful? Give feedback.
Thanks for the question.
OutputT
is the canonical way for events to move from children to ancestors, and even across a few layers hierarchy it can make sense to keep propagating them up — the button workflow's Click output becomes the middle workflow's RecordUpdated output, etc.But we do go for bus-like things sometimes, and in that case, yeah, you're on your own. For us the latter approach is usually less like a bus and more like a repository or other model object, injected via Dagger.