File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed
packages/js-draw/src/util Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -91,9 +91,8 @@ export abstract class ReactiveValue<T> {
91
91
sourceValues : ReactiveValue < any > [ ] ,
92
92
) : ReactiveValue < T > {
93
93
const result = new ReactiveValueImpl ( callback ( ) ) ;
94
- const resultRef = ( window as any ) . WeakRef
95
- ? new ( window as any ) . WeakRef ( result )
96
- : { deref : ( ) => result } ;
94
+ const resultRef =
95
+ typeof WeakRef !== 'undefined' ? new WeakRef ( result ) : { deref : ( ) => result } ;
97
96
98
97
for ( const value of sourceValues ) {
99
98
const listener = value . onUpdate ( ( ) => {
@@ -179,9 +178,7 @@ export abstract class MutableReactiveValue<T> extends ReactiveValue<T> {
179
178
propertyName : Name ,
180
179
) : MutableReactiveValue < SourceType [ Name ] > {
181
180
const child = ReactiveValue . fromInitialValue ( sourceValue . get ( ) [ propertyName ] ) ;
182
- const childRef = ( window as any ) . WeakRef
183
- ? new ( window as any ) . WeakRef ( child )
184
- : { deref : ( ) => child } ;
181
+ const childRef = typeof WeakRef !== 'undefined' ? new WeakRef ( child ) : { deref : ( ) => child } ;
185
182
186
183
// When the source is updated...
187
184
const sourceListener = sourceValue . onUpdate ( ( newValue ) => {
You can’t perform that action at this time.
0 commit comments