Sunday, May 12, 2024
 Popular · Latest · Hot · Upcoming
157
rated 0 times [  161] [ 4]  / answers: 1 / hits: 22051  / 5 Years ago, tue, may 14, 2019, 12:00:00

In my case, I have an access token, and should that token exist, I would return it as an observable of type string:



if (this.accessToken){
return of(this.accessToken);
}


Due to a recent update, I noticed that of is deprecated with the following message:



of is deprecated: use scheduled instead 'scheduled([a, b, c], scheduler)' (deprecation)



The new syntax is quite verbose, would anyone know the equivalent scheduled version of the same simple of? The keyword name makes it difficult to search for information on it.



Thanks!


More From » angular

 Answers
7

Only the overloads that accept a scheduler are deprecated. The variant that you are using is not deprecated, see https://github.com/ReactiveX/rxjs/blob/master/src/internal/observable/of.ts


[#52124] Tuesday, May 7, 2019, 5 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
mickaylag

Total Points: 333
Total Questions: 108
Total Answers: 93

Location: Solomon Islands
Member since Fri, Oct 8, 2021
3 Years ago
;