Skip to content

Instantly share code, notes, and snippets.

@xcarpentier
Created October 13, 2014 10:36
Show Gist options
  • Save xcarpentier/65abca9a772560652b6c to your computer and use it in GitHub Desktop.
Save xcarpentier/65abca9a772560652b6c to your computer and use it in GitHub Desktop.
/* A éviter */
function dataService () {
var someValue = '';
function save () {
/* */
};
function validate () {
/* */
};
return {
save: save,
someValue: someValue,
validate: validate
};
}
/* Recommander */
function dataService () {
var someValue = '';
var service = {
save: save,
someValue: someValue,
validate: validate
};
return service;
////////////
function save () {
/* */
};
function validate () {
/* */
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment