Skip to content

Instantly share code, notes, and snippets.

@yuri91
Last active May 15, 2020 08:24
Show Gist options
  • Save yuri91/ea1891839f2f75e005a2cda619e0dd8e to your computer and use it in GitHub Desktop.
Save yuri91/ea1891839f2f75e005a2cda619e0dd8e to your computer and use it in GitHub Desktop.
Basic example: pass anyref as parameter and return value
#include <cheerp/client.h>
namespace [[cheerp::genericjs]] client {
void jsFunc(client::Element* elem);
}
[[cheerp::wasm]]
[[cheerp::jsexport]]
client::Element* passAndReturn(client::Element* elem)
{
jsFunc(elem);
return elem;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment