79116409

Date: 2024-10-23 05:22:50
Score: 1.5
Natty:
Report link

Why not just cast the subject to an observable?


  private subject = new Subject<string>();
  public subject$ = subject.asObservable();

In this way both pipe and subscribe are available without access to the underlying subject.

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Starts with a question (0.5): Why not
  • Low reputation (0.5):
Posted by: Sam Scholefield