Idris2Doc : Rhone.JS.Util

Rhone.JS.Util

(source)
Utilities not (yet) available from idris2-dom

Definitions

currentTime : HasIOio=>ioInteger
  Get the current time in milliseconds since 1970/01/01.

Visibility: export
dataIntervalID : Type
  ID used to identify and cancel a running timer.

Totality: total
Visibility: public export
setInterval : HasIOio=>Bits32->JSIO () ->ioIntervalID
  Sets a timer to repeatedly carry out the given IO action
after the given number of milliseconds.

Returns an ID, which can be used with `clearInterval` to
cancel the timer.

Visibility: export
clearInterval : HasIOio=>IntervalID->io ()
  Cancel a running timer with the given ID.

Visibility: export
DTime : Type
  Alias for a time delta in milliseconds

Visibility: public export
animate : HasIOio=> (DTime->JSIO ()) ->io (IO ())
  Use `window.requestAnimationFrame` to repeatedly
animate the given function.

The function takes the time delta (in milliseconds) since
the previous animation step as input.

Returns a cleanup action, which can be run to
stop the running animation.

Visibility: export
showFPS : Bits32->String
Visibility: export
fps : Nat->MSFmDTime (EventBits32)
  Averages the frames per second (FPS) of an animation
firing an event with the value every `n` steps.

Visibility: export