composer icon indicating copy to clipboard operation
composer copied to clipboard

combinator/idiom for injecting parameters to invoke an action

Open rabbah opened this issue 6 years ago • 2 comments

  composer.retain(
    composer.value(slackConfig)),
  ({result, params}) => Object.assign(result, params),
  `/whisk.system/slack/post`)

or

  composer.retain(
    composer.value(watsonTranslateConfig)),
  ({result, params}) => Object.assign(result, params),
  `/whisk.system/watson/languageId`)

to avoid creating bindings, or to override parameters/pass secrets to an app.

rabbah avatar Oct 08 '17 19:10 rabbah

the optional properties allowed for a task are merge, input and output, none of these allow one to easily bind parameters to be passed to the task that's called; could build a new combinator for that, or possibly enhance/modify task so that an additional params field is allowed.

this is to make it easier to pass parameters specific to an action without doing the retain/value/smash described above.

rabbah avatar Oct 16 '17 13:10 rabbah

I added example combinators to TEMPLATES.md along these lines.

tardieu avatar May 23 '18 14:05 tardieu