Swappit dispatchesDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/soyleninjs/swappit/llms.txt
Use this file to discover all available pages before exploring further.
CustomEvent instances on window during its lifecycle. All events carry a detail object with handle (string) and url (string) properties.
All event names follow the pattern
swappit:[handle]:[action]. For example, an instance with handle "app" emits swappit:app:update:after.Events
| Event | When emitted | detail.url |
|---|---|---|
swappit:[handle]:update:before | Before fetching starts | The target URL |
swappit:[handle]:update:after | After DOM update succeeds | The target URL |
swappit:[handle]:update:error | On fetch or update error | The target URL |
swappit:[handle]:historyUpdate:before | Before back/forward navigation update | The current pathname + search |
swappit:[handle]:historyUpdate:after | After back/forward navigation update | The current pathname + search |
swappit:[handle]:historyUpdate:error | On error during history navigation | The current pathname + search |
swappit:[handle]:reinit | After reinit() completes | "" (empty string) |
swappit:[handle]:destroy | After destroy() completes | "" (empty string) |
Event detail shape
Every event’sdetail object contains the following fields:
The handle of the Swappit instance that emitted the event.
The URL involved in the operation. For
update and historyUpdate events this is the relative URL being loaded. For reinit and destroy events this is an empty string "".