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
/
controller
/
usePipe.ts
13 lines
(10 loc)
•
264 B
text/typescript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
import
{
type
Ref
,
type
WatchSource
, watch }
from
"vue"
;
/** *
@since
0.2.0 *
@category
Controller
*/
export
function
usePipe<T> (
source
:
WatchSource
<T>,
target
:
Ref
<T> ) {
return
watch
(source,
function
onChange
(
next
) { target.
value
= next; }); }