Created
March 3, 2020 19:19
-
-
Save painedpineapple/6175dfa0016330231967f948f01ff434 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
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."; | |
let mergeDeep = (items: array(array('a))) => | |
items->Belt.Array.reduce([||], (acc, item) => | |
acc->Belt.Array.concat(item) | |
); | |
let arrayKeepSome = array => | |
array->Array.reduce([||], (acc, item) => | |
switch (item) { | |
| None => acc | |
| Some(item) => Array.concat(acc, [|item|]) | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment