@@ -10,7 +10,7 @@ import * as Effect from "effect/Effect"
1010import * as Exit from "effect/Exit"
1111import { globalValue } from "effect/GlobalValue"
1212import type { ComputedRef , InjectionKey , Ref } from "vue"
13- import { computed , inject , ref , watchEffect } from "vue"
13+ import { computed , inject , shallowRef , watchEffect } from "vue"
1414
1515/**
1616 * @since 1.0.0
@@ -74,7 +74,7 @@ export const injectRegistry = (): Registry.Registry => {
7474const useAtomValueRef = < A extends Atom . Atom < any > > ( atom : ( ) => A ) => {
7575 const registry = injectRegistry ( )
7676 const atomRef = computed ( atom )
77- const value = ref ( undefined as any as A )
77+ const value = shallowRef ( undefined as any as A )
7878 watchEffect ( ( onCleanup ) => {
7979 onCleanup ( registry . subscribe ( atomRef . value , ( nextValue ) => {
8080 value . value = nextValue
@@ -201,7 +201,7 @@ export const useAtomSet = <
201201 */
202202export const useAtomRef = < A > ( atomRef : ( ) => AtomRef . ReadonlyRef < A > ) : Readonly < Ref < A > > => {
203203 const atomRefRef = computed ( atomRef )
204- const value = ref < A > ( atomRefRef . value . value )
204+ const value = shallowRef < A > ( atomRefRef . value . value )
205205 watchEffect ( ( onCleanup ) => {
206206 const atomRef = atomRefRef . value
207207 onCleanup ( atomRef . subscribe ( ( next ) => {
0 commit comments