cheerp 如何使用回调的回答

关于如何使用callback方法的问题很好理解,如今比较时尚的语言里都支持异步编程,事件消息或者回调。javascript

这应该是无关优雅的, 在cheerp中你可使用javascript同样的思惟来考虑问题, 这一切编译器已经替咱们处理的很好。java

回调可使用cheerp::Callback()c++

也可使用getter/setter利用动态的装饰的方式来使用回调,也能够写拉姆达表达式.express

pid = setTimeout(cheerp::Callback( -> void { ///hook video events install }), TICK_T);编程

目前好的一点是, cheerp底层已经能够知足一些重度依赖js库的程序, 实现了 js->c++->wasm 混合编程。异步

by 钟元 agent.zy@aliyun.comide

The question of how to use the callback method is well understood. Asynchronous programming, event messages or callbacks are now supported in more fashionable languages.异步编程

This should not be elegant, in cheerp you can use the same thinking as javascript, all of which compilers have handled for us very well.事件

Callback can use cheerp:: Callback ()ip

You can also use getter/setter to use callbacks using dynamic decoration, or you can write Ramda expressions.

PID = setTimeout (cheerp:: Callback ( - > void {

///hook video events install

}, TICK_T); The good thing is that the bottom of cheerp can already satisfy some programs that rely heavily on JS libraries.

JS - > C + + - > WASM mixed programming is realized.

相关文章
相关标签/搜索