index.js 323 B

123456789101112131415161718
  1. import { Cache } from '../../lib/cache/index'
  2. class MyCache extends Cache {
  3. constructor() {
  4. super()
  5. this.instance = null
  6. }
  7. static getInstance() {
  8. if (!this.instance) {
  9. this.instance = new MyCache()
  10. }
  11. return this.instance
  12. }
  13. }
  14. let _myCache = MyCache.getInstance()
  15. export default _myCache