Skip to content
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

Support as and with #6

Merged
merged 9 commits into from
Jan 1, 2021
Merged

Support as and with #6

merged 9 commits into from
Jan 1, 2021

Conversation

cohix
Copy link
Contributor

@cohix cohix commented Dec 31, 2020

TL;DR Variable names and named function args!

This adds support for the as and with clauses in a Directive handler's steps. For example:

steps:
      - group:
        - fn: modify-url
        - fn: helloworld-rs
          as: hello
      - fn: fetch-test
        with:
          - "url: modify-url"
          - "logme: hello"

This allows the developer to do two things:

  • Define the key used to store the result of a function (i.e. helloworld-rs becomes hello in state). This is analogous to "setting a variable"
  • Define a custom state to be passed into a function (i.e. fetch-test gets keys url and logme instead of the "naked" state of modify-url and hello. This is analogous to passing args into a function, since the developer can't expect a function to take args with the names of their other functions.

@cohix cohix merged commit d8704a5 into main Jan 1, 2021
@arbourd arbourd deleted the connor/as-with branch May 5, 2022 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant