reason-log-update
v3.0.0-beta.2
Published
> [bucklescript](https://bucklescript.github.io/en) bindings to [log-update](https://github.com/sindresorhus/log-update)
Downloads
4
Readme
reason-log-update
bucklescript bindings to log-update
Installation
npm install reason-log-update log-update --save
Then add reason-log-update
to bs-dependencies
in bsconfig.json
{
...
"bs-dependencies": [
...
"reason-log-update"
]
}
Usage
let frames = [|"-", "\\", "|", "/"|];
let i = ref(0);
let interval =
Js.Global.setInterval(
() => {
i := (i^ + 1) mod Array.length(frames);
let frame = frames[i^];
LogUpdate.update(
{j|
♥♥
$frame unicorns $frame
♥♥
|j},
);
},
80,
);
ignore(Js.Global.setTimeout(() => Js.Global.clearInterval(interval), 3000));
API
See the LogUpdate.re and the documentation;