Add warning about EventBridge not immediately availble in TabletProxy

This commit is contained in:
David Rowe 2019-12-18 07:15:34 +13:00
parent 5256f58520
commit 7cf216f114

View file

@ -422,6 +422,12 @@ public:
* <pre class="prettyprint"><code>EventBridge.scriptEventReceived.connect(function(message) {
* ...
* });</code></pre>
* <p><strong>Warning:</strong> The <code>EventBridge</code> object is not necessarily set up immediately ready for the web
* page's script to use. A simple workaround that normally works is to add a delay before calling
* <code>EventBridge.scriptEventReceived.connect(...)</code>. A better solution is to periodically call
* <code>EventBridge.scriptEventReceived.connect(...)</code> and then <code>EventBridge.emitWebEvent(...)</code> to send a
* message to the Interface script, and have that send a message back using <code>emitScriptEvent(...)</code>; when the
* return message is received, the <codE>EventBridge</code> is ready for use.</p>
* @function TabletProxy#emitScriptEvent
* @param {string|object} message - The message to send to the web page.
*/