Skip to content

Commit

Permalink
remove unused [@mel.uncurry] attributes (#841)
Browse files Browse the repository at this point in the history
  • Loading branch information
anmonteiro authored Jun 23, 2024
1 parent 39a146f commit 713ab6c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
10 changes: 6 additions & 4 deletions src/React.re
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,9 @@ external displayName: component('props) => option(string) = "displayName";

/* HOOKS */

/* This is used as return values */
type callback('input, 'output) = 'input => 'output;

/*
* Yeah, we know this api isn't great. tl;dr: useReducer instead.
* It's because useState can take functions or non-function values and treats
Expand All @@ -488,13 +491,13 @@ external useReducerWithMapState:
'initialState,
[@mel.uncurry] ('initialState => 'state)
) =>
('state, 'action => unit) =
('state, callback('action, unit)) =
"useReducer";

[@mel.module "react"]
external useSyncExternalStore:
(
~subscribe: ([@mel.uncurry] (unit => unit)) => [@mel.uncurry] (unit => unit),
~subscribe: (unit => unit) => callback(unit, unit),
~getSnapshot: unit => 'snapshot
) =>
'snapshot =
Expand All @@ -503,7 +506,7 @@ external useSyncExternalStore:
[@mel.module "react"]
external useSyncExternalStoreWithServer:
(
~subscribe: ([@mel.uncurry] (unit => unit)) => [@mel.uncurry] (unit => unit),
~subscribe: (unit => unit) => callback(unit, unit),
~getSnapshot: unit => 'snapshot,
~getServerSnapshot: [@mel.uncurry] (unit => 'snapshot)
) =>
Expand Down Expand Up @@ -866,7 +869,6 @@ module Uncurried = {
"useCallback";
};

type callback('input, 'output) = 'input => 'output;
[@mel.module "react"]
external useTransition: unit => (bool, callback(callback(unit, unit), unit)) =
"useTransition";
Expand Down
10 changes: 5 additions & 5 deletions src/React.rei
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,13 @@ external useReducerWithMapState:
('state, 'action => unit) =
"useReducer";

/* This is used as return values */
type callback('input, 'output) = 'input => 'output;

[@mel.module "react"]
external useSyncExternalStore:
(
~subscribe: ([@mel.uncurry] (unit => unit)) => [@mel.uncurry] (unit => unit),
~subscribe: (unit => unit) => callback(unit, unit),
~getSnapshot: unit => 'snapshot
) =>
'snapshot =
Expand All @@ -195,7 +198,7 @@ external useSyncExternalStore:
[@mel.module "react"]
external useSyncExternalStoreWithServer:
(
~subscribe: ([@mel.uncurry] (unit => unit)) => [@mel.uncurry] (unit => unit),
~subscribe: (unit => unit) => callback(unit, unit),
~getSnapshot: unit => 'snapshot,
~getServerSnapshot: [@mel.uncurry] (unit => 'snapshot)
) =>
Expand Down Expand Up @@ -382,9 +385,6 @@ external useMemo7:
([@mel.uncurry] (unit => 'any), ('a, 'b, 'c, 'd, 'e, 'f, 'g)) => 'any =
"useMemo";

/* This is used as return values */
type callback('input, 'output) = 'input => 'output;

[@mel.module "react"] external useCallback: 'fn => 'fn = "useCallback";
[@mel.module "react"]
external useCallback0: ('fn, [@mel.as {json|[]|json}] _) => 'fn =
Expand Down

0 comments on commit 713ab6c

Please sign in to comment.