next-instance
Create an instance without new.
installation
npm install -S @jswork/next-instance
usage
import '@jswork/next-instance';
class Person {
constructor(name, age) {
this.name = name;
this.age = age;
}
}
const p1 = nx.instance(Person, 'fei', 100);
// Person { name: 'fei', age: 100 }
license
Code released under the MIT license.