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 bf5d153
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/stubs.ts
Original file line number Diff line number Diff line change
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 bf5d153

Please sign in to comment.