Skip to content
This repository has been archived by the owner on Nov 18, 2019. It is now read-only.

Documentation is wrong #1

Open
mnpenner opened this issue Jun 1, 2018 · 2 comments
Open

Documentation is wrong #1

mnpenner opened this issue Jun 1, 2018 · 2 comments

Comments

@mnpenner
Copy link

mnpenner commented Jun 1, 2018

README shows

 let source = fromEmitter(events, "data", "error", "close");

and

(default) from-emitter(emitter, onNext, onError, onDone [,selectNext][,selectError])

But the correct syntax appears to be

fromEmitter(events, {
    onNext: 'result',
    onError: 'error',
    onDone: 'end',
})

aka (from the source code):

export default function <T>(
  emitter: EventEmitter,
  opts?: {
    onNext?: string
    onError?: string,
    onDone?: string,
    selectNext?: (...any) => T,
    selectError?: (...any) => any,
    dispose?: () => void,
  }
): AsyncIterable<T> {

Otherwise, this seems to work great! Thank you! I was struggling to create one of these myself.

@MeirionHughes
Copy link
Member

Cheers. yeah this is all very experimental at the moment. I will running through everything in the next few weeks and updating the code and docs. I had some pain points when trying to use these in a webpack app. :/

@mnpenner
Copy link
Author

Any updates? 😄

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

No branches or pull requests

2 participants