Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/rules/no-exposed-subjects.md
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -20,7 +20,7 @@ import { Subject } from "rxjs";
class Answers {
private _answers: Subject<string>;
get answers() {
return this._answers.toObservable();
return this._answers.asObservable();
}
}
```
Expand All @@ -36,4 +36,4 @@ This rule accepts a single option which is an object with an `allowProtected` pr
{ "allowProtected": true }
]
}
```
```