Skip to content

hamizmz/GEMs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

GEMs

Graham's Easy Models

Create your model!

function Person() {
  var secret = 'I still pick my nose and I am 26 years old.'; // just a private variable
  this.prenom = 'Graham';
  this.nom = 'Robertson';
  this.surnom = 'Ham';
  this.age = 26;
  
  // Extend a Gem!
  this.extend = Gem;
  this.extend();
};

Create an instance!

var graham = new Person();

Listen to events!!

graham.subscribe('age', function(val) {
  alert('Wow! ' + graham.prenom + ' a ' + val + ' ans là.  Très cool!');
});

Change values that trigger events!

graham.age = 27; // Not until September 14th, 2015 though...

And that's all!

Have fun :)

About

Graham's Easy Models

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published