Skip to content

Instantly share code, notes, and snippets.

@painedpineapple
Created March 5, 2020 20:04
Show Gist options
  • Save painedpineapple/b5b2f1951c46a2e3438a332a4f8b4b93 to your computer and use it in GitHub Desktop.
Save painedpineapple/b5b2f1951c46a2e3438a332a4f8b4b93 to your computer and use it in GitHub Desktop.
type resizeObserverPolyfill;
[@bs.module "@juggle/resize-observer"]
external polyfill: resizeObserverPolyfill = "ResizeObserver";
type debounce = {
scroll: int,
resize: float,
};
[@bs.deriving abstract]
type params = {
[@bs.optional]
polyfill: resizeObserverPolyfill,
[@bs.optional]
debounce,
[@bs.optional]
scroll: bool,
};
[@bs.module "react"]
external useEffect2:
([@bs.uncurry] (unit => option(unit => unit)), ('a, 'b)) => unit =
"useEffect";
type bounds = {
width: int,
height: int,
left: float,
top: float,
bottom: float,
right: float,
x: float,
y: float,
};
[@bs.module "react-use-measure"]
external use: params => (ReactDOMRe.domRef, bounds) = "default";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment