Skip to content

Instantly share code, notes, and snippets.

@JamieDixon
Created April 8, 2014 16:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JamieDixon/10151162 to your computer and use it in GitHub Desktop.
Save JamieDixon/10151162 to your computer and use it in GitHub Desktop.
function once(fn) {
var isUsed = false;
return function(param){
if(!isUsed)
{
isUsed = true;
fn(param);
return param;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment