initial wasm commit
This commit is contained in:
@@ -83,16 +83,23 @@ const App: FC<IAppProps> = ({ commBus }) => {
|
||||
setSBUsername(username);
|
||||
setIsReady(true);
|
||||
}, []);
|
||||
const wasmCallback = useCallback((data: any) => {
|
||||
console.log('WASM DATA', JSON.parse(data));
|
||||
}, []);
|
||||
useEffect(() => {
|
||||
console.log('Initializing CommBus');
|
||||
|
||||
commBus.on('receiveSimBriefUsername', usernameCallback);
|
||||
commBus.on('khofmann_tfdi_md-11_load_manager_live_data', wasmCallback);
|
||||
|
||||
setTimeout(() => {
|
||||
Coherent.call('COMM_BUS_WASM_CALLBACK', 'requestSimBriefUsername', 'null');
|
||||
}, 1000);
|
||||
|
||||
return () => commBus.off('receiveSimBriefUsername', usernameCallback);
|
||||
return () => {
|
||||
commBus.off('receiveSimBriefUsername', usernameCallback);
|
||||
commBus.off('khofmann_tfdi_md-11_load_manager_live_data', wasmCallback);
|
||||
};
|
||||
}, []);
|
||||
|
||||
return (
|
||||
|
||||
@@ -32,9 +32,7 @@
|
||||
class="ingameUiFrame panelInvisible"
|
||||
content-fit="true"
|
||||
>
|
||||
<virtual-scroll direction="y">
|
||||
<div id="react" style="display: flex"></div>
|
||||
</virtual-scroll>
|
||||
<div id="react" style="display: flex"></div>
|
||||
</ingame-ui>
|
||||
</tfdidesign-md11-load-manager-panel>
|
||||
<script src="index.js" type="text/javascript"></script>
|
||||
|
||||
@@ -16,6 +16,7 @@ class TFDiDesignMD11LoadManagerPanel extends TemplateElement {
|
||||
|
||||
const container = document.getElementById('react');
|
||||
if (container) {
|
||||
console.log('Starting React');
|
||||
const root = createRoot(container);
|
||||
root.render(createElement(App, { commBus: this.commBus }));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user