Skip to main content

SystemListener

interface

A subscription to a host event source, declared at author time. Built by `system.on(...)` and listed in `defineMod`'s `system` slot. The host wires it up on activation and tears it down when the mod unloads, so there is nothing to dispose.

interface SystemListener<TPayload>

Import

import { SystemListener } from '@modular/sdk';

Members6

event
string

Which of that source's events to listen for.

handle
SystemListenerHandler<TPayload>

Runs on every occurrence.

id
string

Identifier, unique within the mod.

kind
'system-listener'
source
`system.${string}`

Which host source to listen to, for example `'system.power'`.

title
string

Label shown where the host lists active subscriptions.

Notes

category
State