Skip to content

Instantly share code, notes, and snippets.

@abalmos
Last active February 8, 2016 20:32
Show Gist options
  • Select an option

  • Save abalmos/9226ca490ec6df0a51ad to your computer and use it in GitHub Desktop.

Select an option

Save abalmos/9226ca490ec6df0a51ad to your computer and use it in GitHub Desktop.
Using input to achieve context without "module"
import signal from './signal.js'
export default (options = {}) => {
return (module) => {
module.addSignals({
signal: signal(['optional', 'context', 'override'])
});
}
}
import set from 'cerebral-addons'
import action1 from './action1.js'
import action2 from './action2.js'
export default (path) => [
set('output:/path', path || ['default', 'path']),
action1, // Use "path" as the context instead of a factory here
action2
];
@abalmos
Copy link
Author

abalmos commented Feb 8, 2016

You can even change "path" on the signal call if you replace set with some sort of setIfUndefined addon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment