maierfelix/azula

Add Object Dispatching API

Closed this issue · 1 comments

There should be a high-level alternative to the Binary Message Dispatching system:

  • Dispatching Objects from Node and the GUI
  • Receiving dispatched Object in Node and the GUI

Proposal:

// to send an Object to Node or the GUI
window.dispatchObject({ value: 42 });

// to receive an Object, which got sent from Node or the GUI
window.onobjectmessage = obj => {
  console.assert(obj.value === 42);
};

Implemented with 60ac2aa