Skip to content

Instantly share code, notes, and snippets.

@gskachkov
Last active April 14, 2018 19:08
Show Gist options
  • Save gskachkov/e43e125a4fe3ceb9ac9d3029a51081e9 to your computer and use it in GitHub Desktop.
Save gskachkov/e43e125a4fe3ceb9ac9d3029a51081e9 to your computer and use it in GitHub Desktop.
Blazor.registerFunction('invoke', msg => {
const logMethod = Blazor.platform.findMethod(
'StandaloneApp', // Assembly name
'BlazorExport', // Namespace
'Helper', // Class name
'Log' // Method name
);
const wasmResult = Blazor.platform.callMethod(logMethod, null, [
Blazor.platform.toDotNetString('Invoke from JS')
]);
const result = Blazor.platform.toJavaScriptString(wasmResult);
console.log(result);
return true;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment