File tree Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ export class EffectScope {
9
9
effects : ( ReactiveEffect | EffectScope ) [ ] = [ ]
10
10
cleanups : ( ( ) => void ) [ ] = [ ]
11
11
12
- constructor ( detached ?: boolean ) {
12
+ constructor ( detached = false ) {
13
13
if ( ! detached ) {
14
14
recordEffectScope ( this )
15
15
}
@@ -39,6 +39,10 @@ export class EffectScope {
39
39
}
40
40
}
41
41
42
+ export function effectScope ( detached ?: boolean ) {
43
+ return new EffectScope ( detached )
44
+ }
45
+
42
46
export function recordEffectScope (
43
47
effect : ReactiveEffect | EffectScope ,
44
48
scope ?: EffectScope | null
Original file line number Diff line number Diff line change @@ -51,5 +51,10 @@ export {
51
51
EffectScheduler ,
52
52
DebuggerEvent
53
53
} from './effect'
54
- export { EffectScope , getCurrentScope , onScopeDispose } from './effectScope'
54
+ export {
55
+ effectScope ,
56
+ EffectScope ,
57
+ getCurrentScope ,
58
+ onScopeDispose
59
+ } from './effectScope'
55
60
export { TrackOpTypes , TriggerOpTypes } from './operations'
Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ export {
29
29
stop ,
30
30
ReactiveEffect ,
31
31
// effect scope
32
+ effectScope ,
32
33
EffectScope ,
33
34
getCurrentScope ,
34
35
onScopeDispose
You can’t perform that action at this time.
0 commit comments