-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Is your change request related to a problem? Please describe.
makeEmitter
:: forall a
. ((a -> Effect Unit) -> Effect (Effect Unit))
-> Emitter a
makeEmitter = coerceThis is a very confusing signature and definition for someone of novice-intermediate language experience. There's no examples, no test case, and what even is ((a -> Effect Unit) -> Effect (Effect Unit))? I think even adding a type alias like the type Canceler = Effect (Effect Unit) could help clarify what's going on. Not sure on the best solution, but currently I find it hard to understand.
Describe the solution you'd like
I started a thread on Discourse about requestAnimationFrame that has a useful, and probably popular use-case for makeEmitter in getting ticks for each frame. It could perhaps be common enough to have an Halogen.Subscriptions.{Common,Extra,Solutions,HTML,DOM,etc.} so the community can have a standardized solution for common problems -- especially for people looking for batteries-included, zephyr-will-clean-up-the-excess fix to "get sh*t done". Obviously you don't want to add DOM/HTML dependencies here, but it'd be a common dep in an application setting.
Additional context
Control.Plus.empty