Skip to content

Instantly share code, notes, and snippets.

@bendrucker
Created February 9, 2016 16:21
Show Gist options
  • Save bendrucker/bb5cfc20dc8848cfccd7 to your computer and use it in GitHub Desktop.
Save bendrucker/bb5cfc20dc8848cfccd7 to your computer and use it in GitHub Desktop.
Organizing JS modules using keywords and language behavior
var dep = require('dep')
module.exports = {
myFn: myFn
}
function myFn (input) {
var myVar = {}
// ...
return myNestedFn()
function myNestedFn () {
return myVar.a * 2 + myOuterFn(input)
}
}
function myOuterFn (input) {
return input * 2
}
@chinedufn
Copy link

I see this a lot in your repos.

Have a name for this pattern?


EDIT: nvm -> 'Organizing JS modules using keywords and language behavior'

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