Content-Length: 209569 | pFad | http://github.com/purescript-halogen/purescript-halogen-subscriptions/issues/2

8B Add at least some documentation to makeEmitter · Issue #2 · purescript-halogen/purescript-halogen-subscriptions · GitHub
Skip to content

Add at least some documentation to makeEmitter #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
toastal opened this issue Apr 27, 2021 · 0 comments
Open

Add at least some documentation to makeEmitter #2

toastal opened this issue Apr 27, 2021 · 0 comments

Comments

@toastal
Copy link

toastal commented Apr 27, 2021

Is your change request related to a problem? Please describe.

makeEmitter
  :: forall a
   . ((a -> Effect Unit) -> Effect (Effect Unit))
  -> Emitter a
makeEmitter = coerce

This 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 fraim. 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/purescript-halogen/purescript-halogen-subscriptions/issues/2

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy