DimaFr / angular-advanced-ex1

JB Angular Advanced Course Ex1
0 stars 0 forks source link

BehaviorSubject VS Subject #1

Open ywarezk opened 4 years ago

ywarezk commented 4 years ago

https://github.com/DimaFr/angular-advanced-ex1/blob/046887da1992d0d186d8eff5f36747ee8dc9f4bf/projects/throttling/src/app/directives/tasks.directive.ts#L15

Subject is a bit more fitting here, since you don't really need to initiate the subject with an initial value (the empty string is not really relevant here) Also you don't need to access the last value the subject holds also when subscribing you don't want an initial jump of the listeners.