feat:hook use native call to avoid promise async queue

This commit is contained in:
pengfei.zhou 2019-11-22 17:01:44 +08:00
parent c4d64ff74a
commit 660503e88c

View File

@ -15,7 +15,7 @@
*/ */
import './../runtime/global' import './../runtime/global'
import { View, Group } from "./view"; import { View, Group } from "./view";
import { loge } from '../util/log'; import { loge, log } from '../util/log';
import { Model } from '../util/types'; import { Model } from '../util/types';
import { Root } from './layout'; import { Root } from './layout';
@ -117,6 +117,8 @@ export abstract class Panel {
} }
private hookAfterNativeCall() { private hookAfterNativeCall() {
//Here insert a native call to ensure the promise is resolved done.
log('Check Dirty')
if (this.__root__.isDirty()) { if (this.__root__.isDirty()) {
const model = this.__root__.toModel() const model = this.__root__.toModel()
this.nativeRender(model) this.nativeRender(model)