How to use setTimeout in PureScript v0.7 -


i want use settimeout animation in purescript this.

loop n =   if n > 100       return unit   else     print n     timeout (loop n+1) 30 

purescript-timers no longer work in v0.7.

i don't have slightest idea how implement this.

there 2 ways:

  1. use purescript-js-timers purescript-contrib.

  2. use purescript-aff (later').

i prefer later, , here example:

import control.monad.aff aff  update :: forall eff. action -> state -> effmodel state action (eff) update myaction mystate =    { state: mystate, effects: [ aff.later' 1000 $ pure myotheraction ] } 

Comments

Popular posts from this blog

python - Healpy: From Data to Healpix map -

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -