3.0.0-beta.2 • Published 4 years ago

reason-log-update v3.0.0-beta.2

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

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;