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
const initialState = { | |
// The current state of the battle | |
currentState: 'SELECT_MOVE', | |
// The active Pokemon on each side | |
activePokemon: [null, null], | |
// The remaining health of each Pokemon | |
health: [0, 0], | |
// The moves available to each Pokemon | |
moves: [[], []], | |
// The current move being used by each Pokemon |
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
/** | |
* 1. Make sure "glob" is installed globally | |
* 2. Update src path if necessary | |
* 3. Run `node res_of_re.js` | |
*/ | |
let glob = require("glob"); | |
let { exec } = require("child_process"); | |
glob("src/**/*.re", (err, files) => { |
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
// Component: https://github.com/airbnb/react-outside-click-handler | |
[@bs.module "react-outside-click-handler"] [@react.component] | |
external make: | |
( | |
~onOutsideClick: unit => unit, | |
~children: React.element, | |
~disabled: bool=?, | |
~useCapture: bool=?, | |
~display: [@bs.string] [ |
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
open Utils; | |
type align = [ | `right | `left]; | |
module Style = { | |
open Css; | |
let root = | |
style([ | |
zIndex(50), |
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
module CountDown = { | |
/** matches css animation play states */ | |
type playState = [ | `running | `paused]; | |
type value = { | |
time: int, | |
play: unit => unit, | |
pause: unit => unit, | |
restart: unit => unit, | |
playState, |
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
/** | |
* Dependencies: | |
* - Utils | |
* - bs-css | |
* - react-spring (and bindings: bs-react-spring) | |
* - react-use-memo (and bindings: custom) | |
* - Close Icon | |
* - Loader/Spinner | |
*/ | |
open Utils; |
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 resizeObserverPolyfill; | |
[@bs.module "@juggle/resize-observer"] | |
external polyfill: resizeObserverPolyfill = "ResizeObserver"; | |
type debounce = { | |
scroll: int, | |
resize: float, | |
}; |
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
/** | |
* This is deprecated. I recommend using https://gist.github.com/thislogancall/8d13eac0cc9a9435921817be071650a4 | |
*/ | |
open Utils; | |
[%raw {| | |
require("react-notifications-component/dist/theme.css") | |
|}]; |
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
open Belt; | |
let str = React.string; | |
let rem_of_px = pixel => (pixel->float_of_int /. 16.)->Css.rem; | |
let createMarkup = str => <span dangerouslySetInnerHTML={"__html": str} />; | |
let unknownErrorMessage = "An unknown error has occurred."; |
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, | |
}; |
NewerOlder