File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed
Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change 88 reactive ,
99 readonly ,
1010 ref ,
11+ shallowRef ,
1112 toRaw ,
13+ triggerRef ,
1214} from '../src'
1315
1416/**
@@ -520,3 +522,16 @@ describe('reactivity/readonly', () => {
520522 expect ( r . value ) . toBe ( ro )
521523 } )
522524} )
525+
526+ test ( 'should be able to trigger with 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+ } )
Original file line number Diff line number Diff line change @@ -93,6 +93,12 @@ export class Dep {
9393 */
9494 sc : number = 0
9595
96+ /**
97+ * @internal
98+ */
99+ readonly __v_skip = true
100+ // TODO isolatedDeclarations ReactiveFlags.SKIP
101+
96102 constructor ( public computed ?: ComputedRefImpl | undefined ) {
97103 if ( __DEV__ ) {
98104 this . subsHead = undefined
You can’t perform that action at this time.
0 commit comments