Lifecycle
Understand how the engine and plugins initialize and clean up.
Engine Lifecycle
- Create
CoreEngine
- Create Konva
Stage
and layers - Initialize managers (
NodeManager
,CameraManager
,VirtualizationManager
) - Attach plugins
Plugin Lifecycle
import { Plugin, type CoreEngine } from "@flowscape-ui/core-sdk";
class MyPlugin extends Plugin {
protected onAttach(core: CoreEngine) {
// subscribe to events, add visuals, timers, etc.
}
protected onDetach(core: CoreEngine) {
// unsubscribe, destroy visuals, clear timers
}
}
Plugins are attached at engine construction time via the plugins
option or later using the plugins
registry.