Advertisement
Guest User

Untitled

a guest
Oct 15th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const cache = {}
  2.  
  3. function fn (state, emit) {
  4.   return function (Component, id, ...args) {
  5.     if (cache[id] !== undefined) return cache[id]
  6.     cache[id] = new Component(this, state, emit, args)
  7.     return cache[id]
  8.   }
  9. }
  10.  
  11. export default fn
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement