Last active
March 3, 2020 16:36
-
-
Save painedpineapple/def6c9709b6b306f9d8b9c217f765b85 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type timerValue = { | |
seconds: int, | |
minutes: int, | |
hours: int, | |
days: int, | |
start: unit => unit, | |
pause: unit => unit, | |
restart: unit => unit, | |
}; | |
type timerProps = { | |
expiryTimestamp: float, // timestamp | |
onExpire: unit => unit, | |
}; | |
[@bs.module "react-timer-hook"] | |
external useTimer: timerProps => timerValue = "useTimer"; | |
type stopWatchValue = { | |
seconds: int, | |
minutes: int, | |
hours: int, | |
days: int, | |
start: unit => unit, | |
pause: unit => unit, | |
reset: unit => unit, | |
}; | |
type stopWatchProps = {autoStart: bool}; | |
[@bs.module "react-timer-hook"] | |
external useStopWatch: stopWatchProps => stopWatchValue = "useStopWatch"; | |
type timeValue = { | |
seconds: int, | |
minutes: int, | |
hours: int, | |
ampm: string, | |
}; | |
type timeProps = {format: string}; | |
[@bs.module "react-timer-hook"] | |
external useTime: timeProps => timeValue = "useTime"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment