Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: change react promise status type #31623

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion packages/react-client/src/ReactFlightClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,14 @@ const RESOLVED_MODULE = 'resolved_module';
const INITIALIZED = 'fulfilled';
const ERRORED = 'rejected';

type ReactPromiseStatus =
| typeof PENDING
| typeof BLOCKED
| typeof RESOLVED_MODEL
| typeof RESOLVED_MODULE
| typeof INITIALIZED
| typeof ERRORED;

type PendingChunk<T> = {
status: 'pending',
value: null | Array<(T) => mixed>,
Expand Down Expand Up @@ -203,7 +211,7 @@ type SomeChunk<T> =

// $FlowFixMe[missing-this-annot]
function ReactPromise(
status: any,
status: ReactPromiseStatus,
value: any,
reason: any,
response: Response,
Expand Down