diff --git a/src/components.ts b/src/components.ts index 8480b59a..948bd958 100644 --- a/src/components.ts +++ b/src/components.ts @@ -100,7 +100,7 @@ export abstract class Component extends Controller * `init()` could be called from the server and the browser, so do not use any DOM-only methods * here. Put those in `create()` instead. */ - init(_model: ChildModel): void {} + init?(_model: ChildModel): void; /** * Method called by Derby once a component is loaded and ready in the DOM. @@ -110,7 +110,7 @@ export abstract class Component extends Controller * * This will only be called in the browser. */ - create?: (() => void) | (() => Promise); + create?(): void; destroy() { this.emit('destroy');