client script example

PHOTO EMBED

Mon May 16 2022 13:26:23 GMT+0000 (Coordinated Universal Time)

Saved by @alenkis #javascript

// a) on load:
import './override.css'
function onMount() {
  // this should be code that's safe to run eagerly (no danger of race conditions of any kind). Application codebase will call onMount() as soon as it can.
  ...
}

// b) on demand (UI events)
window.bonsaiCallback = function () {
  ...
  // any synchronous code can happen right away, but for any communication with our application codebase, there should be a way how to send a message (event):
  application.send(...)
}

// Listener for messages from application
application.receive((msg) => {...})
content_copyCOPY