README
Typescript Partials (αlpha release)
Inspired from C# partial classes for typescript, Simplified 🎀 syntax that may help divide functionality of a single class into multiple 🍬🍬🍬 class files
Install
Install dependencies with npm:
npm i partials
Import
import partial from 'partials';
Add your partial classes 🍬🍬🍬
@partial export class Employee {
@partial work: EmployeeWork;
@partial lunch: EmployeeLunch;
start() {
this.work.doWork();
this.lunch.goToLunch();
}
}
@partial export class EmployeeWork {
@partial model: EmployeeModel;
doWork() {
console.log(`doWork()`);
}
}
@partial export class EmployeeLunch {
@partial model: EmployeeModel;
goToLunch() {
console.log(`goToLunch()`);
}
}
Use your class
new Employee().start()
// Ouputs:
// goToWork()
// goToLunch()