ash-project/reactor

Add `reactor` step type.

Closed this issue · 1 comments

Add the ability to merge another reactor with the current reactor as a special step-type to allow for reactor composition, for example:

defmodule SignUpNewUser do
  use Reactor

  input :email
  input :password
  input :plan_name
  
  step :register_user, RegisterUser do
    argument :email, input(:email)
    argument :password, input(:password)
  end

  reactor :create_subscription, CreateStripeSubscriptionReactor do
    input :user, result(:register_user)
    input :plan_name, input(:plan_name)
  end
end

Note that this isn't just a step which executes another reactor, but actually merges the child reactor's steps into the parent's plan.

Closed by #14