Skip to content

Instantly share code, notes, and snippets.

@hwclass
Created July 2, 2015 08:28
Show Gist options
  • Save hwclass/c2e3149950ce5ceff864 to your computer and use it in GitHub Desktop.
Save hwclass/c2e3149950ce5ceff864 to your computer and use it in GitHub Desktop.
Singleton Pattern (Config.js)
// models/Config.js
module.exports = (function () {
return function () {
var config = {
urls : {
tabs : {
address : '/#address',
payment : '/#payment'
}
},
messages : {
errors : {
no_address_selected : 'Please, select an address to go next',
no_cards_used : 'You need to choose a credit card to pay',
default : 'An error occured. Please try again later'
}
}
}
var getConfig = function () {
return config;
}
return {
getConfig : getConfig
}
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment