-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch implementation #13
Comments
Hey @emaglio , does this solution seems similar to https://2019.trailblazer.to/2.1/docs/activity.html#activity-wiring-api-path- ? Was the |
@yogeshjain999 is that solution allows more that 2 options? the |
@emaglio Yes, we can add more outputs. step :decide_type,
Output(:failure) => Path(connect_to: Id(:finalize), &failure_path),
Output(:success) => Path(connect_to: Id(:finalize), &success_path) I guess we should document this also in website. |
I don't know @yogeshjain999 that looks really complicated to read. |
Hmm understood. So the activity for above chart would look like this, It might be difficult to understand this initially, but I guess over the time it gets easier to look at.
BTW - |
Yeah well that doesn’t look too bad at all I think! We should document this properly with a Switch paragraph where we just use this structure. |
Yep, cool. |
I actually don't think that a macro on top of that would be wrong? We could provide it in a separate gem and see how it feels? I wouldn't dare to confront every TRB user with all those wiring details if all they want to have is just a "simple" switch. |
Hmm, you mean defining macro which uses I'm not really sure if we should provide another identical way to implement |
An abstraction using |
The aim is to have a simple API to be able to recreate a case/when block with TRB.
Here the flowchart of an operation using a
Switch
macro:Requirements:
Possible API solution:
Here the branch where a draft implementation has been done (not the best but the tests are reusable): https://github.com/trailblazer/trailblazer-macro/tree/macro_switch
The text was updated successfully, but these errors were encountered: