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

feat(react): add startTransition #838

Merged
merged 2 commits into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions src/React.re
Original file line number Diff line number Diff line change
Expand Up @@ -872,10 +872,15 @@ module Uncurried = {
"useCallback";
};

type callback('input, 'output) = 'input => 'output;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is already defined in line 471

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just saw 757dd23

Copy link
Contributor Author

@r17x r17x Jul 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for confusing @anmonteiro, I should have PASSED Pipelines before merge this PR.


[@mel.module "react"]
external useTransition: unit => (bool, callback(callback(unit, unit), unit)) =
"useTransition";

[@mel.module "react"]
external startTransition: ([@mel.uncurry] (unit => unit)) => unit = "startTransition";

[@mel.module "react"]
external useDebugValue: ('value, ~format: 'value => string=?, unit) => unit =
"useDebugValue";
Expand Down
3 changes: 3 additions & 0 deletions src/React.rei
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,9 @@ module Uncurried: {
"useCallback";
};

[@mel.module "react"]
external startTransition: ([@mel.uncurry] (unit => unit)) => unit = "startTransition";

[@mel.module "react"]
external useTransition: unit => (bool, callback(callback(unit, unit), unit)) =
"useTransition";
Expand Down
Loading