UNPKG
@cran/lib.vue.ref
Version:
latest (0.2.3)
0.2.3
0.2.2
0.2.1
0.2.0
0.1.2
0.1.1
0.1.0
0.0.1
Vue Reactivity Extensions
@cran/lib.vue.ref
/
src
/
utility
/
withScope.ts
15 lines
(9 loc)
•
245 B
text/typescript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import
{ type
EffectScope
, getCurrentScope }
from
"vue"
;
export
function
withScope
(
callback: ( scope: EffectScope ) =>
void
) {
const
scope =
getCurrentScope
();
if
(scope) {
callback
(scope);
return
true
; }
return
false
; }