Skip to content

Commit a7141d4

Browse files
committed
feat: adding an effectScope to app instance
1 parent f8f37d9 commit a7141d4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/runtime-core/src/apiCreateApp.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import { installAppCompatProperties } from './compat/global'
2929
import type { NormalizedPropsOptions } from './componentProps'
3030
import type { ObjectEmitsOptions } from './componentEmits'
3131
import type { DefineComponent } from './apiDefineComponent'
32+
import type { EffectScope } from '@vue/reactivity'
3233

3334
export interface App<HostElement = any> {
3435
version: string
@@ -71,6 +72,7 @@ export interface App<HostElement = any> {
7172
_container: HostElement | null
7273
_context: AppContext
7374
_instance: ComponentInternalInstance | null
75+
_scope: EffectScope
7476

7577
/**
7678
* v2 compat only
@@ -229,6 +231,7 @@ export function createAppAPI<HostElement>(
229231
_container: null,
230232
_context: context,
231233
_instance: null,
234+
_scope: scope,
232235

233236
version,
234237

@@ -402,7 +405,7 @@ export function createAppAPI<HostElement>(
402405
const lastApp = currentApp
403406
currentApp = app
404407
try {
405-
return scope.run(fn)!
408+
return app._scope.run(fn)!
406409
} finally {
407410
currentApp = lastApp
408411
}

0 commit comments

Comments
 (0)