File tree 4 files changed +26
-0
lines changed
4 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -768,6 +768,8 @@ if (enableUseMemoCacheHook) {
768
768
} ;
769
769
}
770
770
771
+ function noop ( ) : void { }
772
+
771
773
function use < T > (usable: Usable< T > ): T {
772
774
if ( usable !== null && typeof usable === 'object' ) {
773
775
// $FlowFixMe[method-unbinding]
@@ -793,6 +795,11 @@ function use<T>(usable: Usable<T>): T {
793
795
index ,
794
796
) ;
795
797
if ( prevThenableAtIndex !== null ) {
798
+ if ( thenable !== prevThenableAtIndex ) {
799
+ // Avoid an unhandled rejection errors for the Promises that we'll
800
+ // intentionally ignore.
801
+ thenable . then ( noop , noop ) ;
802
+ }
796
803
switch ( prevThenableAtIndex . status ) {
797
804
case 'fulfilled' : {
798
805
const fulfilledValue : T = prevThenableAtIndex . value ;
Original file line number Diff line number Diff line change @@ -768,6 +768,8 @@ if (enableUseMemoCacheHook) {
768
768
} ;
769
769
}
770
770
771
+ function noop ( ) : void { }
772
+
771
773
function use < T > (usable: Usable< T > ): T {
772
774
if ( usable !== null && typeof usable === 'object' ) {
773
775
// $FlowFixMe[method-unbinding]
@@ -793,6 +795,11 @@ function use<T>(usable: Usable<T>): T {
793
795
index ,
794
796
) ;
795
797
if ( prevThenableAtIndex !== null ) {
798
+ if ( thenable !== prevThenableAtIndex ) {
799
+ // Avoid an unhandled rejection errors for the Promises that we'll
800
+ // intentionally ignore.
801
+ thenable . then ( noop , noop ) ;
802
+ }
796
803
switch ( prevThenableAtIndex . status ) {
797
804
case 'fulfilled' : {
798
805
const fulfilledValue : T = prevThenableAtIndex . value ;
Original file line number Diff line number Diff line change @@ -610,6 +610,11 @@ function use<T>(usable: Usable<T>): T {
610
610
index ,
611
611
) ;
612
612
if ( prevThenableAtIndex !== null ) {
613
+ if ( thenable !== prevThenableAtIndex ) {
614
+ // Avoid an unhandled rejection errors for the Promises that we'll
615
+ // intentionally ignore.
616
+ thenable . then ( noop , noop ) ;
617
+ }
613
618
switch ( prevThenableAtIndex . status ) {
614
619
case 'fulfilled' : {
615
620
const fulfilledValue : T = prevThenableAtIndex . value ;
Original file line number Diff line number Diff line change @@ -121,6 +121,8 @@ function useId(): string {
121
121
return ':' + currentRequest.identifierPrefix + 'S' + id.toString(32) + ':';
122
122
}
123
123
124
+ function noop ( ) : void { }
125
+
124
126
function use< T > (usable: Usable< T > ): T {
125
127
if ( usable !== null && typeof usable === 'object' ) {
126
128
// $FlowFixMe[method-unbinding]
@@ -147,6 +149,11 @@ function use<T>(usable: Usable<T>): T {
147
149
index ,
148
150
) ;
149
151
if ( prevThenableAtIndex !== null ) {
152
+ if ( thenable !== prevThenableAtIndex ) {
153
+ // Avoid an unhandled rejection errors for the Promises that we'll
154
+ // intentionally ignore.
155
+ thenable . then ( noop , noop ) ;
156
+ }
150
157
switch ( prevThenableAtIndex . status ) {
151
158
case 'fulfilled' : {
152
159
const fulfilledValue : T = prevThenableAtIndex . value ;
You can’t perform that action at this time.
0 commit comments