Skip to content

RFC: Resubscribe on errors in ComponentStore.effect() #3962

Open
@e-oz

Description

@e-oz

Which @ngrx/* package(s) are relevant/related to the feature request?

component-store

Information

Right now, there are two possible ways to accidentally "kill" an effect:

  1. Forgetting to catch an error in the body of the function passed to effect().
  2. Forgetting to catch an error in the observable that is passed as a value for an effect.

There is a simple way to avoid them in the effect() itself: resubscribe on errors using retry().

Describe any alternatives/workarounds you're currently using

Currently, the closest alternative for option(1) is tapResponse(), although it's easy to forget or to put it in the wrong place.

I would be willing to submit a PR to fix this issue

  • Yes
  • No

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions