0.0.3 • Published 9 years ago

prototype-decorator v0.0.3

Weekly downloads
1
License
MIT
Repository
github
Last release
9 years ago

Prototype Decorator

This project made because right now the class initializing spec it unclear and both in the current spec there is a missing key of what happen when you need to initialize a propery for using it with super class constructor. However when the environment isn't set to production, it will throw if you override existing property of the class.

Installing

npm install prototype-decorator

How to use

import prototype from 'prototype-decorator';


class Parent {
  constructor() {
    console.log(this.hello);
  }
}

@prototype({ hello: "hello world!" })
class Child {}

new Child(); // log: hello world!