Skip to content

Instantly share code, notes, and snippets.

@fruchtose
Created November 22, 2012 23:16
Show Gist options
  • Save fruchtose/4133280 to your computer and use it in GitHub Desktop.
Save fruchtose/4133280 to your computer and use it in GitHub Desktop.
everymodule#step method implementation
step: function (name) {
var steps = this._steps
, sequence = this._currSeq;
if (!sequence)
throw new Error("You can only declare a step after declaring a route alias via `get(...)` or `post(...)`.");
sequence.orderedStepNames.push(name);
this._currentStep =
steps[name] || (steps[name] = new Step(name, this));
// For configuring what the actual business
// logic is:
// fb.step('fetchOAuthUser') generates the method
// fb.fetchOAuthUser whose logic can be configured like
// fb.fetchOAuthUser( function (...) {
// // Business logic goes here
// } );
this.configurable(name,
'STEP FN [' + name + '] function encapsulating the logic for the step `' + name + '`.');
return this;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment