Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/afeiship/next-stub-singleton
Stub code for singleton.
https://github.com/afeiship/next-stub-singleton
instance next singleton stub
Last synced: 19 days ago
JSON representation
Stub code for singleton.
- Host: GitHub
- URL: https://github.com/afeiship/next-stub-singleton
- Owner: afeiship
- License: mit
- Created: 2018-12-28T15:53:27.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-05-24T04:43:28.000Z (over 1 year ago)
- Last Synced: 2024-10-28T07:22:25.364Z (2 months ago)
- Topics: instance, next, singleton, stub
- Language: JavaScript
- Homepage:
- Size: 34.2 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# next-stub-singleton
> Stub code for singleton.[![version][version-image]][version-url]
[![license][license-image]][license-url]
[![size][size-image]][size-url]
[![download][download-image]][download-url]## installation
```shell
yarn add @jswork/next-stub-singleton
```## usage
```ts
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](https://github.com/afeiship/next-stub-singleton/blob/master/LICENSE.txt).[version-image]: https://img.shields.io/npm/v/@jswork/next-stub-singleton
[version-url]: https://npmjs.org/package/@jswork/next-stub-singleton[license-image]: https://img.shields.io/npm/l/@jswork/next-stub-singleton
[license-url]: https://github.com/afeiship/next-stub-singleton/blob/master/LICENSE.txt[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/next-stub-singleton
[size-url]: https://github.com/afeiship/next-stub-singleton/blob/master/dist/next-stub-singleton.min.js[download-image]: https://img.shields.io/npm/dm/@jswork/next-stub-singleton
[download-url]: https://www.npmjs.com/package/@jswork/next-stub-singleton