File tree Expand file tree Collapse file tree 1 file changed +11
-8
lines changed
packages/react-relay/relay-hooks Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change 13
13
14
14
import type { Disposable , IEnvironment } from 'relay-runtime' ;
15
15
16
- const invariant = require ( 'invariant ' ) ;
16
+ const warning = require ( 'warning ' ) ;
17
17
18
18
const TEMPORARY_RETAIN_DURATION_MS = 5 * 60 * 1000 ;
19
19
@@ -38,13 +38,16 @@ class SuspenseResource {
38
38
dispose : ( ) => {
39
39
this . _retainCount = Math . max ( 0 , this . _retainCount - 1 ) ;
40
40
if ( this . _retainCount === 0 ) {
41
- invariant (
42
- this . _retainDisposable != null ,
43
- 'Relay: Expected disposable to release query to be defined.' +
44
- "If you're seeing this, this is likely a bug in Relay." ,
45
- ) ;
46
- this . _retainDisposable . dispose ( ) ;
47
- this . _retainDisposable = null ;
41
+ if ( this . _retainDisposable != null ) {
42
+ this . _retainDisposable . dispose ( ) ;
43
+ this . _retainDisposable = null ;
44
+ } else {
45
+ warning (
46
+ false ,
47
+ 'Relay: Expected disposable to release query to be defined.' +
48
+ "If you're seeing this, this is likely a bug in Relay." ,
49
+ ) ;
50
+ }
48
51
}
49
52
} ,
50
53
} ;
You can’t perform that action at this time.
0 commit comments