我是Rx的新手。并且一直在观察Observables和Subjects。我最近遇到了一种名为ScalarObservable
的观察者。什么是ScalarObservable
,它与常规的可观测值有什么不同?
我还注意到你可以通过observbale.value
属性获取其values属性。这种做法是推荐的吗?
答案 0 :(得分:2)
是否推荐这种做法?
是。标量可观察量是具有单个值的可观察量。
此处演示了使用com.google.android.gms.gcm.GcmNetworkManager: can't find referenced method 'java.lang.Object zzb(java.lang.Object,java.lang.Object)' in program class com.google.android.gms.common.internal.zzu
there were 3 unresolved references to program class members.
com.google.android.gms.gcm.GcmNetworkManager: can't find referenced method 'void zzb(boolean,java.lang.Object)' in program class com.google.android.gms.common.internal.zzu
there were 1 unresolved references to library class members.
com.google.android.gms.gcm.Task$Builder: can't find referenced method 'void zzb(boolean,java.lang.Object)' in program class com.google.android.gms.common.internal.zzu
com.google.android.gms.gcm.zza: can't find referenced method 'void setLatestEventInfo(android.content.Context,java.lang.CharSequence,java.lang.CharSequence,android.app.PendingIntent)' in library class android.app.Notification
:https://github.com/ReactiveX/rxjs/blob/e91d113e49acc9b0e12e2524040fa84cf3fa2c78/spec/observables/ScalarObservable-spec.ts#L10