Skip to content

Add blockUntilX functions #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
JordanMartinez opened this issue Jul 20, 2023 · 0 comments
Open

Add blockUntilX functions #2

JordanMartinez opened this issue Jul 20, 2023 · 0 comments

Comments

@JordanMartinez
Copy link
Contributor

A pattern I'm noticing in downstream Node libraries is something like this:

blockUntil1
  :: forall eventEmitter
   . eventEmitter 
  -> EventHandle eventEmitter (a -> Effect Unit) (EffectFn1 a Unit) 
  -> Aff Arg
blockUntil1 ee eventH = makeAff \done -> do
  removeListener <- ee # once eventH \arg ->
    done $ Right arg
  pure $ effectCanceler removeListener
@JordanMartinez JordanMartinez changed the title Add until function Add blockUntilX functions Jul 20, 2023
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