I have few sagas which can be used independently and in another more high-level sagas. Just curious what is the proper way to use shared arguments/stages with such workflow.
Right now I have two functions process(%Sage{} = sage) which running all stages and run(...). So I assume required data always in effects_so_far. For run function I pass accepted arguments into "fake" stages:
Sage.new()
|> Sage.run(:required_effect, fn _effects, _params -> {:ok, arg1} end)
What is proper way to do it?
I have few sagas which can be used independently and in another more high-level sagas. Just curious what is the proper way to use shared arguments/stages with such workflow.
Right now I have two functions
process(%Sage{} = sage)which running all stages andrun(...). So I assume required data always ineffects_so_far. Forrunfunction I pass accepted arguments into "fake" stages:What is proper way to do it?