Feature: allow throwError
to accept a factory function
#5617
Labels
feature
PRs and issues for features
throwError
to accept a factory function
#5617
The thought is this: Frequently, you don't want to create an
Error
object until the moment the error happens. However, currently,throwError
only accepts the instance of the error it is going to throw as an argument.I'm wondering if we could allow it to optionally take a factory function that will create the error at the moment of subscription.
This would be a breaking change, however, as right now, it's possible to emit a function as an error by using
throwError
:Current behavior when you provide a function
Proposed change
The text was updated successfully, but these errors were encountered: