File tree Expand file tree Collapse file tree 4 files changed +26
-0
lines changed Expand file tree Collapse file tree 4 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -768,6 +768,8 @@ if (enableUseMemoCacheHook) {
768768 } ;
769769}
770770
771+ function noop ( ) : void { }
772+
771773function use < T > (usable: Usable< T > ): T {
772774 if ( usable !== null && typeof usable === 'object' ) {
773775 // $FlowFixMe[method-unbinding]
@@ -793,6 +795,11 @@ function use<T>(usable: Usable<T>): T {
793795 index ,
794796 ) ;
795797 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+ }
796803 switch ( prevThenableAtIndex . status ) {
797804 case 'fulfilled' : {
798805 const fulfilledValue : T = prevThenableAtIndex . value ;
Original file line number Diff line number Diff line change @@ -768,6 +768,8 @@ if (enableUseMemoCacheHook) {
768768 } ;
769769}
770770
771+ function noop ( ) : void { }
772+
771773function use < T > (usable: Usable< T > ): T {
772774 if ( usable !== null && typeof usable === 'object' ) {
773775 // $FlowFixMe[method-unbinding]
@@ -793,6 +795,11 @@ function use<T>(usable: Usable<T>): T {
793795 index ,
794796 ) ;
795797 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+ }
796803 switch ( prevThenableAtIndex . status ) {
797804 case 'fulfilled' : {
798805 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 {
610610 index ,
611611 ) ;
612612 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+ }
613618 switch ( prevThenableAtIndex . status ) {
614619 case 'fulfilled' : {
615620 const fulfilledValue : T = prevThenableAtIndex . value ;
Original file line number Diff line number Diff line change @@ -121,6 +121,8 @@ function useId(): string {
121121 return ':' + currentRequest.identifierPrefix + 'S' + id.toString(32) + ':';
122122}
123123
124+ function noop ( ) : void { }
125+
124126function use< T > (usable: Usable< T > ): T {
125127 if ( usable !== null && typeof usable === 'object' ) {
126128 // $FlowFixMe[method-unbinding]
@@ -147,6 +149,11 @@ function use<T>(usable: Usable<T>): T {
147149 index ,
148150 ) ;
149151 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+ }
150157 switch ( prevThenableAtIndex . status ) {
151158 case 'fulfilled' : {
152159 const fulfilledValue : T = prevThenableAtIndex . value ;
You can’t perform that action at this time.
0 commit comments