Closed dcrockwell closed 8 years ago
Currently, there are a lot of .binds to make this pattern work:
export default class StimpakProject { constructor(stimpak) { stimpak .logo(`Project Generator v${packageJson.version}`) .then(this.promptProjectBasicInformation.bind(this)); } promptProjectBasicInformation(stimpak, done) { stimpak .use(StimpakProjectBasicInformation) .then(this.promptVersionControl.bind(this)); done(); } promptVersionControl(stimpak, done) { stimpak .use(StimpakVersionControl) .then(this.promptNpm.bind(this)); done(); } promptNpm(stimpak, done) { stimpak .use(StimpakNpm) .then(this.promptGithub.bind(this)); done(); } promptGithub(stimpak, done) { stimpak .use(StimpakGithub) .then(this.promptTranspiling.bind(this)); done(); } promptTranspiling(stimpak, done) { stimpak .use(StimpakTranspiling); done(); } }
We could add a .context(newContextObject) method to set the context for all internal steps.
.context(newContextObject)
stimpak.context(someObject); stimpak.then(function (stimpak, done) { // this === someObject });
Closed by https://github.com/FreeAllMedia/stimpak/pull/25
Currently, there are a lot of .binds to make this pattern work:
We could add a
.context(newContextObject)
method to set the context for all internal steps.