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.

相關文章
相關標籤/搜索