1.1.2 • Published 6 years ago

progenitor.js v1.1.2

Weekly downloads
19
License
MIT
Repository
github
Last release
6 years ago

progenitor.js

Circle CI
Build Status
npm version

#Getting started

###Install it

$ npm install progenitor.js

###Require it

var progenitor = require('progenitor.js');

###Use it

// To enable inheritance from Object and Error
Object.progeny = progenitor(Object);
Error.progeny = progenitor(Error);

then

BaseController = Object.progeny('BaseController', {
  // Instance methods
}, {
  classMethods: {
  }
});

The interface to inherit is progeny(newName, instanceMethods, options)

  • options can have a key classMethods that add methods to the class itself.
  • the class is accessible via this.class.
  • the special instance method init is called when during the process of returning a new object.
  • the special instance method this.super(functionName, *args) will call any super class instance method. (Note: it will not error if the method does not exist)
  • the special class method inherited is called during the process of generating a new derived class.
1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

8 years ago

1.0.12

8 years ago

1.0.11

8 years ago

1.0.10

8 years ago

1.0.9

8 years ago

1.0.8

9 years ago

1.0.7

9 years ago

1.0.6

9 years ago

1.0.5

9 years ago

1.0.4

9 years ago

1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

0.9.1

9 years ago

0.9.0

9 years ago