headerViewModelBulder{ // headerViewModelBulder is generated by Expoxy
btnClick{
Log.d("get data:${state.name}")
}
}
}
When the data changes, headerViewModelBulder() executes again, but the data retrieved from the log remains unchanged because the state object points to the previous address.
The reason is that the callback was not updated and was set for the first time。
Corresponding generated code logic:
if (((btnClick_Function0 == null) != (that.btnClick_Function0 == null))) {
object.seBtnClick(......); //Update callback again, but not executed here.
}
I think the ability to repeatedly set callbacks should be supported
eg: private fun buildHeader(state: HeaderState){
}
When the data changes, headerViewModelBulder() executes again, but the data retrieved from the log remains unchanged because the state object points to the previous address.
The reason is that the callback was not updated and was set for the first time。
Corresponding generated code logic:
if (((btnClick_Function0 == null) != (that.btnClick_Function0 == null))) {
object.seBtnClick(......); //Update callback again, but not executed here. }
I think the ability to repeatedly set callbacks should be supported