miso
Copyright(C) 2016-2026 David M. Johnson
LicenseBSD3-style (see the file LICENSE)
MaintainerDavid M. Johnson <code@dmj.io>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Miso.Subscription.RAF

Description

A Sub for requestAnimationFrame. Meant to be used in Canvas based animations / games to achieve 60fps.

main :: IO ()
main = startApp defaultEvents comp { subs = [ rAFSub Tick ] }

data Action = Tick Double
Synopsis

Documentation

rAFSub :: (Double -> action) -> Sub action Source #

A Sub for 60FPS animations when using requestForAnimationFrame.

The Double returned is a DOMHighResTimeStamp expressed in milliseconds.