-
-
Couldn't load subscription status.
- Fork 2k
Description
Which @ngrx/* package(s) are the source of the bug?
effects
Minimal reproduction of the bug/regression with instructions
This has already been reported by #3052, I understand the behavior and why It's not recommended to do that,
I think the implementation details of createEffect leak when the return returns a symbol.
myEffect = createEffect(() => {
if(someCondition) {
return EMPTY.
}
...
});
or also
const obs:Observable<any> = new Observable();
const eff1 = createEffect(() => obs);
const eff2 = createEffect(() => obs);
Both codes throw Cannot redefine property: __@ngrx/effects_create__, which is basically an implementation detail of the createEffect function that would happen if defineProperty had the option configurable: true by default.
For the sake of compleness, this issue doesn't arise when the Zone.js legacy patch is loaded which changes the behavior of Object.defineProperty, see angular/angular/issues/37432
Expected behavior
The error should be more explicit / or it shouldn't error at all.