(state: ThenableState)
| 37 | export opaque type ThenableState = ThenableStateDev | ThenableStateProd; |
| 38 | |
| 39 | function getThenablesFromState(state: ThenableState): Array<Thenable<any>> { |
| 40 | if (__DEV__) { |
| 41 | const devState: ThenableStateDev = (state: any); |
| 42 | return devState.thenables; |
| 43 | } else { |
| 44 | const prodState = (state: any); |
| 45 | return prodState; |
| 46 | } |
| 47 | } |
| 48 | |
| 49 | // An error that is thrown (e.g. by `use`) to trigger Suspense. If we |
| 50 | // detect this is caught by userspace, we'll log a warning in development. |