Feature/zpf (#564)
* iOS: fix memory leak of blur effect * js: fix callback cause memory leak
This commit is contained in:
		| @@ -73,14 +73,22 @@ class CounterView extends ViewHolder { | ||||
| class CounterVM extends ViewModel<CountModel, CounterView> { | ||||
|   onAttached(s: CountModel, vh: CounterView) { | ||||
|     vh.counter.onClick = () => { | ||||
|       Promise.resolve(this.getState().count).then(count => { | ||||
|         Promise.resolve().then(() => { | ||||
|           this.updateState((state) => { | ||||
|             state.count = count + 1; | ||||
|           }); | ||||
|         }) | ||||
|       }) | ||||
|       setInterval(() => { | ||||
|         // this.updateState(state => { | ||||
|         //   state.count++ | ||||
|         // }) | ||||
|         this.context.callNative("demo", "test2", "sdfsf") | ||||
|         //loge("setInterval") | ||||
|       }, 1) | ||||
|     }; | ||||
|     vh.number.onClick = () => { | ||||
|       setInterval(() => { | ||||
|         // this.updateState(state => { | ||||
|         //   state.count++ | ||||
|         // }) | ||||
|         this.context.callNative("demo", "test") | ||||
|       }, 1) | ||||
|     } | ||||
|   } | ||||
|   onBind(s: CountModel, vh: CounterView) { | ||||
|     vh.number.text = `${s.count}`; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user