load and unload syntax

This commit is contained in:
2025-11-29 18:01:34 +01:00
parent 848d2758d7
commit 2dc6f4a38a
3 changed files with 10 additions and 44 deletions

View File

@@ -1,38 +0,0 @@
{
"compilerOptions": {
"moduleResolution": "Node",
"target": "ESNext",
"module": "ESNext",
/**
* svelte-preprocess cannot figure out whether you have
* a value or a type, so tell TypeScript to enforce using
* `import type` instead of `import` for Types.
*/
"importsNotUsedAsValues": "error",
"isolatedModules": true,
"resolveJsonModule": true,
/**
* To have warnings / errors of the Svelte compiler at the
* correct position, enable source maps by default.
*/
"sourceMap": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"baseUrl": ".",
/**
* Typecheck JS in `.svelte` and `.js` files by default.
* Disable this if you'd like to use dynamic types.
*/
"checkJs": true
},
/**
* Use global.d.ts instead of compilerOptions.types
* to avoid limiting type declarations.
*/
"include": [
"src/**/*.d.ts",
"src/**/*.js",
"src/**/*.svelte"
]
}

View File

@@ -165,10 +165,10 @@ export function initRuntimeEvents(){
EventsOn('LOAD_PROJECT', loadProject)
// Handle a peripheral loaded in the project
EventsOn('LOAD_PERIPHERAL', loadPeripheral)
EventsOn('PERIPHERAL_LOAD', loadPeripheral)
// Handle a peripheral unloaded from the project
EventsOn('UNLOAD_PERIPHERAL', unloadPeripheral)
EventsOn('PERIPHERAL_UNLOAD', unloadPeripheral)
// Handle a peripheral event
EventsOn('PERIPHERAL_EVENT_EMITTED', onPeripheralEvent)
@@ -191,10 +191,10 @@ export function destroyRuntimeEvents(){
EventsOff('LOAD_PROJECT')
// Handle a peripheral loaded in the project
EventsOff('LOAD_PERIPHERAL')
EventsOff('PERIPHERAL_LOAD')
// Handle a peripheral unloaded from the project
EventsOff('UNLOAD_PERIPHERAL')
EventsOff('PERIPHERAL_UNLOAD')
// Handle a peripheral event
EventsOff('PERIPHERAL_EVENT_EMITTED')