My weird case is when I do ```var myVariable: Int ...
# rx
b
My weird case is when I do
Copy code
var myVariable: Int = 0
    private set(value) {
      field = value
      BehaviorSubject.onNext(BehaviorSubject.value)
   }
z
why have an additional variable for this? just store it in a behavior subject. if you need immediate access, that is what behaviorSubject.value is for.
👍 1
p
It's convenient, especially if you have a lot of accesses
I have a property so you can say
var myVariable by _myVariable