UNPKG
vuse-rx
Version:
latest (0.14.0)
next (0.14.0-rc.11)
0.14.0
0.14.0-rc.11
0.14.0-rc.10
0.14.0-rc.9
0.14.0-rc.8
0.14.0-rc.7
0.14.0-rc.6
0.14.0-rc.5
0.14.0-rc.4
0.14.0-rc.3
0.14.0-rc.2
0.14.0-rc.1
0.13.1
0.13.1-rc.0
0.13.0
0.13.0-rc.2
0.13.0-rc.1
0.13.0-rc.0
0.12.0
0.12.0-rc.17
0.12.0-rc.16
0.12.0-rc.15
0.12.0-rc.14
0.12.0-rc.13
0.12.0-rc.12
0.12.0-rc.11
0.12.0-rc.10
0.12.0-rc.9
0.12.0-rc.8
0.12.0-rc.7
0.12.0-rc.6
0.12.0-rc.5
0.12.0-rc.4
0.12.0-rc.3
0.12.0-rc.2
0.12.0-rc.1
0.12.0-rc.0
0.10.0
0.10.0-rc.13
0.10.0-rc.12
0.10.0-rc.11
0.10.0-rc.10
0.10.0-rc.9
0.10.0-rc.8
0.10.0-rc.7
0.10.0-rc.6
0.10.0-rc.5
0.10.0-rc.4
0.10.0-rc.3
0.10.0-rc.2
0.10.0-rc.1
0.10.0-rc.0
0.9.0
0.9.0-rc.0
0.8.2
0.8.1
0.8.0
0.7.0
0.6.1
0.6.0
0.5.0
0.4.1
0.4.0
0.3.0
0.2.0
0.1.1
0.1.0
0.0.0
First-class rxjs support for Vue 3
vuse-rx.raiondesu.dev
Raiondesu/vuse-rx
vuse-rx
/
src
/
operators
/
set-ref.ts
8 lines
(6 loc)
•
205 B
text/typescript
View Raw
1
2
3
4
5
6
7
8
import
{ tap }
from
'rxjs/operators'
;
import
{
Ref
}
from
'vue'
;
/** * Sets a ref's value to current observable value. */
export
const
setRef = <T>
(
ref: Ref<T>
) =>
tap<T>({
next
:
v
=>
ref.
value
= v });