File tree Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -48,6 +48,8 @@ import type {
48
48
} from './types'
49
49
import { resolveInjections } from './inject'
50
50
51
+ export const cache = new Map < any , any > ( ) // TODO: properly type this
52
+
51
53
export /* @__PURE__ */ function createComposableFromMixin <
52
54
Props extends Readonly < ExtractPropTypes < PropsOptions > > & EmitsToProps < E > ,
53
55
VM extends CreateComponentPublicInstance <
@@ -118,6 +120,10 @@ export /* @__PURE__ */ function createComposableFromMixin<
118
120
// mixins,
119
121
} = mixin
120
122
123
+ if ( cache . has ( mixin ) ) {
124
+ return cache . get ( mixin ) as any
125
+ }
126
+
121
127
const composable = ( ) => {
122
128
const instance = getCurrentInstance ( ) !
123
129
const vm = instance . proxy ! as VM
@@ -219,6 +225,8 @@ export /* @__PURE__ */ function createComposableFromMixin<
219
225
props,
220
226
emits,
221
227
} )
228
+
229
+ cache . set ( mixin , composable )
222
230
return composable as typeof composable & { props : PropsOptions ; emits : E }
223
231
}
224
232
You can’t perform that action at this time.
0 commit comments