We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
triggerRef
shallowRef
1 parent fafbea7 commit f88bfc0Copy full SHA for f88bfc0
packages/reactivity/__tests__/readonly.spec.ts
@@ -8,7 +8,9 @@ import {
8
reactive,
9
readonly,
10
ref,
11
+ shallowRef,
12
toRaw,
13
+ triggerRef,
14
} from '../src'
15
16
/**
@@ -520,3 +522,16 @@ describe('reactivity/readonly', () => {
520
522
expect(r.value).toBe(ro)
521
523
})
524
525
+
526
+test('should able to trigger on triggerRef', () => {
527
+ const r = shallowRef({ a: 1 })
528
+ const ror = readonly(r)
529
+ let dummy
530
+ effect(() => {
531
+ dummy = ror.value.a
532
+ })
533
+ r.value.a = 2
534
+ expect(dummy).toBe(1)
535
+ triggerRef(ror)
536
+ expect(dummy).toBe(2)
537
+})
0 commit comments