Skip to content

Commit

Permalink
chore: improve type for stub cache
Browse files Browse the repository at this point in the history
The current one does not compile with TS v4.8 changes
  • Loading branch information
cexbrayat committed Aug 31, 2022
1 parent f930013 commit 8b8638c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/stubs.ts
Expand Up @@ -132,7 +132,7 @@ const resolveComponentStubByName = (componentName: string, stubs: Stubs) => {
function createStubOnceForType(
type: ConcreteComponent,
factoryFn: () => ConcreteComponent,
cache: WeakMap<{} & VNodeTypes, ConcreteComponent>
cache: WeakMap<ConcreteComponent, ConcreteComponent>
): ConcreteComponent {
const cachedStub = cache.get(type)
if (cachedStub) {
Expand All @@ -149,7 +149,7 @@ export function stubComponents(
shallow = false,
renderStubDefaultSlot = false
) {
const createdStubsMap: WeakMap<{} & VNodeTypes, ConcreteComponent> =
const createdStubsMap: WeakMap<ConcreteComponent, ConcreteComponent> =
new WeakMap()

const createStubOnce = (
Expand Down

0 comments on commit 8b8638c

Please sign in to comment.