1.1.1 • Published 6 years ago

gollumts-trait v1.1.1

Weekly downloads
10
License
-
Repository
github
Last release
6 years ago

GollumTS-Trait

Simple trait decorator for TS class.

Install

npm install gollumts-trait

Use trait

import {Trait} from "gollumts-trait";

export class Animal {
	
	public eat(): void {
		console.log('This animal eatttt.');
	};
	
}


export class Human implements Animal {
	
	@Trait(Animal) 
	public eat(): void {};
	
}

Result

let human = new Human();

human.eat() //  display: 'This animal eatttt.'