Dojo NG is being built in the open, one section at a time — follow along on Heptapod.

API REFERENCE · FEEDBACK

<dj-global-event>

Non-visual; attaches listeners to window/document for its lifetime. Set windowListeners / documentListeners (maps of event name → handler) as properties.

Try it in the playground

@dojo-ng/global-event · v0.1.1

npm install @dojo-ng/global-event

import "@dojo-ng/global-event";

Properties

PropertyAttributeTypeDefault
windowListeners Property only Listeners {}
documentListeners Property only Listeners {}

Types

The types that the properties above use, as they are declared in the source.

Listeners

type Listeners = Record<string, (e: Event) => void>;