think-instance

add .getInstance method for class

Usage no npm install needed!

<script type="module">
  import thinkInstance from 'https://cdn.skypack.dev/think-instance';
</script>

README

think-instance

Build Status Coverage Status npm

Install

npm install think-instance

How to Use

const thinkInstance = require('think-instance');
let cls = class {
  constructor(conf1, conf2){

  }
}
cls = thinkInstance(cls);
const instance = cls.getInstance(conf1, conf2);