Skip to content

Instantly share code, notes, and snippets.

@ElemarJR
Created November 2, 2012 16:18
Show Gist options
  • Select an option

  • Save ElemarJR/4002395 to your computer and use it in GitHub Desktop.

Select an option

Save ElemarJR/4002395 to your computer and use it in GitHub Desktop.
define(['./logger'],
function (logger) {
var
_c = 0,
increment = function () {
logger.log("incrementing counter to " + ++_c);
return _c;
},
decrement = function() {
logger.log("decrementing counter to " + --_c);
return _c;
},
reset = function() {
logger.log("reseting counter");
return (_c = 0);
};
return {
increment : increment,
decrement : decrement,
reset : reset
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment