Remove nativeEmpty, check call change to native side

This commit is contained in:
pengfei.zhou
2021-09-16 11:53:32 +08:00
committed by osborn
parent 3d3f646845
commit dd4e8db3ad
20 changed files with 72 additions and 93 deletions

View File

@@ -57,9 +57,11 @@ class CounterVM extends ViewModel<CountModel, CounterView> {
onAttached(s: CountModel, vh: CounterView) {
vh.counter.onClick = () => {
Promise.resolve(this.getState().count).then(count => {
this.updateState((state) => {
state.count = count + 1;
});
Promise.resolve().then(() => {
this.updateState((state) => {
state.count = count + 1;
});
})
})
};
}