Utility
-
BJNObservable
is a generic type that generates a callback when its value is changed. It can be used to listen in on changes to a specific value, but not to update the value itself.BJNObservable
is read-only, for write capabilities, seeBJNMutableObservable
Monitor any change to the value as:
See moreclientMuteState.onChange { print("the client is now \(clientMuteState.value ? "muted" : "unmuted")") }
-
BJNMutableObservable
is aBJNObservable
that allows its value to be changed.To modify a
BJNMutableObservable
‘s value,mutableObservableVar.value = true
As a subclass of
BJNObservable
, you can still listen in on value changes.
See moremutableObservableVar.onChange { print("value changed to ", mutableObservableVar.value) }
-
-