no-rxstate-imperative-in-reactive
Warns against using RxState subscription methods outside constructor.
Rationale
Using RxState methods which manage subscriptions (state#hold
or state#connect
) anywhere other than constructor is usually indicative of a non-reactive approach.
Configuration
You may supply an array of method names where hold
and connect
should also be allowed in addition to constructors (e.g. Angular lifecycle methods):
"rules": {
"@rx-angular/no-rxstate-subscriptions-outside-constructor": [
"error",
{ "allowedMethods": ["ngOnInit"] }
]
}