Page tree
Skip to end of metadata
Go to start of metadata

Centralized events require the actual implementation to be part of the main bundle loaded on startup so that the functions are available in the global context.

With this approach, there are no constraints in terms of how the files are structured.
It is important that the functions are exported as part of the main index.ts.

client-logic/helloWorld.ts
export default function helloWorld() {
?? console.log('Hello world!');
}
index.ts
import helloWorld from 'client-logic/helloWorld';
export default??{ helloWorld };

As part of the webui build, webpack will create a bundle which will expose index.ts as a preconfigured namespace. (ex. 'app')

In the designer, when calling into the function, it will be done relative to the configured namespace:
EventAttribute: '$ app.helloWorld();'

  • No labels