Search code examples
reduxrxjsobservablengrx

Is there a way to avoid circular reference in an observable?


Using ngrx, I store an observable inside a store, and I get the following error.

enter image description here

this is because I try to store an object of classA with an observable, and that some other class subscribed to it.

My question is, is there a way to avoid circular reference in an observable? or in ngrx to ignore this property ?


Solution

  • Don't store an observable in the store. Your actions and store should be serializable. https://ngrx.io/guide/store#key-concepts