1.0.0 • Published 5 years ago
@mustafah/partials v1.0.0
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 partialsImport
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()1.0.0
5 years ago