hello, why custom setters for private properties a...
# announcements
d
hello, why custom setters for private properties are not called inside lambdas? For public property its ok but for private property its set directly without setter (checked via decompiling bytecode to java) .. relevant code
Copy code
private var cartProducts: List<CartProduct> = listOf()
   set(value) {
       field = value
       // show value in UI
    }
    
init {
	   productsRepository.observeProducts()
                .subscribe({
                    cartProducts = it.map { CartProduct(it, Random().nextInt(10) + 1) }
                }, { it.printStackTrace() })
}
the setter for cartProducts is not called
r
david.bilik: what are doing here. Make a observer call in init.