diff --git a/docs/rules/no-exposed-subjects.md b/docs/rules/no-exposed-subjects.md index 62f2402f..51d8f67e 100644 --- a/docs/rules/no-exposed-subjects.md +++ b/docs/rules/no-exposed-subjects.md @@ -1,6 +1,6 @@ # Avoid public and protected subjects (`no-exposed-subjects`) -This rule prevents the public or protected subjects. Developers should instead expose observables via the subjects' `toObservable` method. +This rule prevents the public or protected subjects. Developers should instead expose observables via the subjects' `asObservable` method. ## Rule details @@ -20,7 +20,7 @@ import { Subject } from "rxjs"; class Answers { private _answers: Subject; get answers() { - return this._answers.toObservable(); + return this._answers.asObservable(); } } ``` @@ -36,4 +36,4 @@ This rule accepts a single option which is an object with an `allowProtected` pr { "allowProtected": true } ] } -``` \ No newline at end of file +```