Skip to content

Commit

Permalink
fix(createSharedComposable): use tryOnScopeDispose instead of onScope…
Browse files Browse the repository at this point in the history
…Dispose (vitest-dev#725)
  • Loading branch information
Danmer committed Sep 8, 2021
1 parent a4199cd commit 9e006e3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/shared/createSharedComposable/index.ts
@@ -1,4 +1,5 @@
import { effectScope, EffectScope, onScopeDispose } from 'vue-demi'
import { effectScope, EffectScope } from 'vue-demi'
import { tryOnScopeDispose } from '../tryOnScopeDispose'

/**
* Make a composable function usable with multiple Vue instances.
Expand All @@ -25,7 +26,7 @@ export function createSharedComposable<Fn extends((...args: any[]) => any)>(comp
scope = effectScope(true)
state = scope.run(() => composable(...args))
}
onScopeDispose(dispose)
tryOnScopeDispose(dispose)
return state
})
}

0 comments on commit 9e006e3

Please sign in to comment.