2

I was looking at this document: https://rxviz.com/examples at pause-and-resume

In line 10 it same something along this lines:

pauseResume$.pipe(

Any one knows what does that mean?

Rod Ramírez
  • 1,138
  • 11
  • 22

2 Answers2

12

It is a convention followed by the Observable Angular docs explains it in details.

This convention was added after Angular 5 (so it might happen that it couldn't be found in lower versions before 5).

This is what Angular docs said about $ sign.

Naming conventions for observables

Because Angular applications are mostly written in TypeScript, you will typically know when a variable is an observable. Although the Angular framework does not enforce a naming convention for observables, you will often see observables named with a trailing “$” sign.

This can be useful when scanning through code and looking for observable values. Also, if you want a property to store the most recent value from an observable, it can be convenient to simply use the same name with or without the “$”.

Kamran Khatti
  • 3,754
  • 1
  • 20
  • 31
1

It is a convention for an observable. It's not needed, but people have got into the habit of using them, like underscores for private variables.

See: https://stevenschwenke.de/DollarSignsInVariableNamesForObservablesInTypeScript

The original Angular style guide considered taking a stand on this issue, and end up not doing so. See Ward Bell's comment in the archival documentation: https://github.com/angular/angular.io/issues/2039

We do not recommend the $ suffix. It smacks of Hungarian notation. But neither do we wish to prohibit it. A deliberate silence is our course ... for now.

David Rinck
  • 6,637
  • 4
  • 45
  • 60