Skip to content

Instantly share code, notes, and snippets.

@asticode
Last active December 2, 2017 14:49
Show Gist options
  • Save asticode/f6b530d6c930367c9301ba39a080d423 to your computer and use it in GitHub Desktop.
Save asticode/f6b530d6c930367c9301ba39a080d423 to your computer and use it in GitHub Desktop.
// This will wait for the astilectron namespace to be ready
document.addEventListener('astilectron-ready', function() {
// This will listen to messages sent by GO
astilectron.onMessage(function(message) {
// Process message
if (message.name === "event.name") {
return {payload: message.message + " world"};
}
});
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment