简体   繁体   中英

PureScript Halogen How to create an event which fires every frame?

I need to do specific animation in Halogen.Each frame should be asked to update the state in order to properly draw each step. Is there any subscription mechanism for such cases? I tried to use FRP.Event.TIme, but I do not understand how to raise queries from the subscribe function.

This SO answer gives an excellent explanation of how subscribing to event sources works in Halogen. The type signatures are tricky so it's worth taking the time to study that answer.

I would only add that you might need to use a lifecycleComponent in order to initialize the subscription.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM