@jswork/next-stub-singleton

1.0.7 • Public • Published

next-stub-singleton

Stub code for singleton.

version license size download

installation

yarn add @jswork/next-stub-singleton

usage

import "@jswork/next-stub-singleton";

class Person {
  constructor(public name) {
    this.name = name;
  }
}

Object.assign(Person, nx.stubSingleton());

const app = (Person as unknown as SingletonType).getInstance("abc");

console.log(app);

license

Code released under the MIT license.

Package Sidebar

Install

npm i @jswork/next-stub-singleton

Homepage

js.work

Weekly Downloads

73

Version

1.0.7

License

MIT

Unpacked Size

5.84 kB

Total Files

6

Last publish

Collaborators

  • afeiship