Skip to content

Instantly share code, notes, and snippets.

@kalebpederson
Created September 8, 2014 23:53
Show Gist options
  • Save kalebpederson/f68062009b8a182e19e1 to your computer and use it in GitHub Desktop.
Save kalebpederson/f68062009b8a182e19e1 to your computer and use it in GitHub Desktop.
define(['dep'], function(dep) {
function aFunc() {
// do something with dep as captured in closure
}
return {
myFunc: aFunc
};
});
@TheSisb
Copy link

TheSisb commented Sep 9, 2014

I like to clean it up like this:

define(['dep'], function(dep) {
  // Private
  var privateA = 1;

  // Exposed 
  var coolThing = {
    myFunc: function() {
      // cool things
    }
  };

  return coolThing;
});

But it doesn't really matter lol

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