-
BREAKING CHANGE: Interaction API refactor - interactions now use
thiscontext withthis.on(),this.target,this.signal, andthis.raiseInteractions are now functions that receive an
Interactioncontext viathis:// Before function MyInteraction(target: EventTarget, signal: AbortSignal) { createContainer(target, { signal }).set({ ... }) } // After function MyInteraction(this: Interaction) { this.on(this.target, { ... }) // or for different targets this.on(this.target.ownerDocument, { ... }) }
The
Interactioncontext provides:this.target- The target elementthis.signal- Abort signal for cleanupthis.raise- Error handler (renamed fromonError)this.on(target, listeners)- Create a container with automatic signal/error propagation
-
BREAKING CHANGE: Simplify descriptor API - descriptors now extend
AddEventListenerOptionsdirectlyRemoved
capture()andlistenWith()helper functions. Consumers now provide options inline using descriptor objects:// removed capture((event) => {}) listenWith({ once: true }, (event) => {}) // new API { capture: true, listener(event) {} } { once: true, listener(event) {} }
-
BREAKING CHANGE: Remove
onsignal overload, just use containers directly// removed on(target, signal, listeners) // on is just a shortcut now let dispose = on(target, listeners) dispose() // use containers for signal cleanup let container = createContainer(target, { signal })
-
Added
onErrorhandler so containers can handle listener errors in one place (avoids Remix Component needing to wrap EventListener interfaces to raise to<Catch>)createContainer(target, { onError(error) { // handle error }, })