Skip to content

fromEvent in v7 #6450

Jun 4, 2021 · 1 comments · 4 replies
Discussion options

You must be logged in to vote

you should not set generic type parameters explicitly:

/** @deprecated Do not specify explicit type parameters. Signatures with type parameters that cannot be inferred will be removed in v8. */

you should remove them:

const event$ = rxjs.merge(
  rxjs.fromEvent(feed, "data"),
  // convert error events to errors.
  rxjs.fromEvent(feed, "error").pipe(rxOperator.tap(err => { throw err; }))
);

ofc this only works, if feed event listeners are properly typed with overloads for different events. if not, then you probably need to resort to a type cast:

const event$ = rxjs.merge(
  rxjs.fromEvent(feed, "data"),
  // convert error events to errors.
  rxjs.fromEvent(feed, "error").pipe(rxOperator.tap(

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@pratikgaikwadhive
Comment options

@backbone87
Comment options

@cartant
Comment options

@pratikgaikwadhive
Comment options

Answer selected by pratikgaikwadhive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants