BitBonsai Labs Mauricio Wolff's geekness

27Apr/100

JS Tip: Revealing Module Pattern

From Christian Heilmann. Nothing too fancy for those who are used to write jQ plugins, but nice to save it for reference...

var myApp = function(){
	var nome = 'Mauricio Wolff';
	var idade = 35;
 
	function insertPessoa(){
		// [...]
	}
 
	function updatePessoa(){
		// [...]
	}
 
	function setPessoa () {
		// [ usa insert ou update ]
	}
 
	function getPessoa () {
		// [...]
	}
 
	return{
		set: setPessoa,
		get: getPessoa
	}
}();
 
// Example usage:
myApp.get();
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


No trackbacks yet.