Last active
February 8, 2016 20:32
-
-
Save abalmos/9226ca490ec6df0a51ad to your computer and use it in GitHub Desktop.
Using input to achieve context without "module"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import signal from './signal.js' | |
| export default (options = {}) => { | |
| return (module) => { | |
| module.addSignals({ | |
| signal: signal(['optional', 'context', 'override']) | |
| }); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | |
| ]; |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can even change "path" on the signal call if you replace
setwith some sort ofsetIfUndefinedaddon