- Install these packages:
yarn install --dev @babel/core @babel/preset-env jest babel-jest
- Add
babel.config.js
(exactlybabel.config.js
, not.babelrc
, not.babelrc.json
etc):
module.exports = {
open Belt; | |
type t(+'a) = Js.Promise.t('a); | |
type error = Js.Promise.error; | |
type result('ok, 'error) = t(Result.t('ok, 'error)); | |
external errorToString: error => string = "%identity"; | |
[@bs.new] |
open Belt; | |
type t(+'a) = Js.Promise.t('a); | |
type error = Js.Promise.error; | |
type result('ok, 'error) = t(Result.t('ok, 'error)); | |
[@bs.new] | |
external make: | |
( |
type transitionHook = Dom.htmlElement => unit; | |
module type Css = { | |
let duration: int; | |
let appear: string; | |
let enter: string; | |
let exit: string; | |
let appearActive: string; | |
let enterActive: string; | |
let exitActive: string; |
yarn install --dev @babel/core @babel/preset-env jest babel-jest
babel.config.js
(exactly babel.config.js
, not .babelrc
, not .babelrc.json
etc):module.exports = {
A slightly modified version of standard ReScript's Js.Promise
module.
Key differences are:
Promise.result
and Promise.wait
(which is what I want most of the time in apps)Soundness is on the same level as in the original bindings.
If you want more safety, consider reason-promise
.
// Hybrid Logical Clocks implementation in Rust. | |
// Based on: | |
// - https://cse.buffalo.edu/tech-reports/2014-04.pdf | |
// - https://github.com/jlongster/crdt-example-app/blob/master/shared/timestamp.js | |
// - https://github.com/jaredly/hybrid-logical-clocks-example/blob/master/src/hlc.js | |
use std::{ | |
char, cmp, fmt, num, ops, str, | |
time::{Duration, SystemTime, UNIX_EPOCH}, | |
}; |