@jswork/next-instance

1.0.0 • Public • Published

next-instance

Create an instance without new.

version license size download

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.

Package Sidebar

Install

npm i @jswork/next-instance

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

4.49 kB

Total Files

5

Last publish

Collaborators

  • afeiship