feat:add pureCallEntityMethod,avoid hook affects

This commit is contained in:
pengfei.zhou
2021-04-14 16:53:38 +08:00
committed by osborn
parent b762b9db4b
commit 009e8734b6
37 changed files with 266 additions and 209 deletions

View File

@@ -27,7 +27,6 @@ export class FlowLayoutItem extends Stack {
export class FlowLayout extends Superview {
private cachedViews: Map<string, FlowLayoutItem> = new Map
private ignoreDirtyCallOnce = false
allSubviews() {
if (this.loadMoreView) {
@@ -80,18 +79,7 @@ export class FlowLayout extends Superview {
this.cachedViews.set(`${itemIdx}`, view)
return view
}
isDirty() {
if (this.ignoreDirtyCallOnce) {
this.ignoreDirtyCallOnce = false
//Ignore the dirty call once.
return false
}
return super.isDirty()
}
private renderBunchedItems(start: number, length: number) {
this.ignoreDirtyCallOnce = true;
return new Array(Math.min(length, this.itemCount - start)).fill(0).map((_, idx) => {
const listItem = this.getItem(start + idx)
return listItem.toModel()

View File

@@ -30,7 +30,6 @@ export class ListItem extends Stack {
export class List extends Superview {
private cachedViews: Map<string, ListItem> = new Map
private ignoreDirtyCallOnce = false
allSubviews() {
if (this.loadMoreView) {
@@ -83,17 +82,7 @@ export class List extends Superview {
return view
}
isDirty() {
if (this.ignoreDirtyCallOnce) {
this.ignoreDirtyCallOnce = false
//Ignore the dirty call once.
return false
}
return super.isDirty()
}
private renderBunchedItems(start: number, length: number) {
this.ignoreDirtyCallOnce = true
return new Array(Math.max(0, Math.min(length, this.itemCount - start))).fill(0).map((_, idx) => {
const listItem = this.getItem(start + idx)
return listItem.toModel()

View File

@@ -31,8 +31,6 @@ export class SlideItem extends Stack {
export class Slider extends Superview {
private cachedViews: Map<string, SlideItem> = new Map
private ignoreDirtyCallOnce = false
allSubviews() {
return this.cachedViews.values()
}
@@ -58,17 +56,7 @@ export class Slider extends Superview {
return view
}
isDirty() {
if (this.ignoreDirtyCallOnce) {
this.ignoreDirtyCallOnce = false
//Ignore the dirty call once.
return false
}
return super.isDirty()
}
private renderBunchedItems(start: number, length: number) {
this.ignoreDirtyCallOnce = true;
return new Array(Math.min(length, this.itemCount - start)).fill(0).map((_, idx) => {
const slideItem = this.getItem(start + idx)
return slideItem.toModel()