BJNObservable

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, see BJNMutableObservable

Monitor any change to the value as:

clientMuteState.onChange {
    print("the client is now \(clientMuteState.value ? "muted" : "unmuted")")
}
  • A Combine publisher that publishes a new value every time the value changes.

  • Represents the value of this BJNObservable. Read only.

  • Register a callback to be executed when the value of this BJNObservable changes.

  • Remove a previously subscribed callback handler. That handler will no longer be executed when the value of the BJNObservable changes.