• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

sebnitu / vrembem / 11810101198
93%
main: 100%

Build:
Build:
LAST BUILD BRANCH: next
DEFAULT BRANCH: main
Ran 13 Nov 2024 03:32AM UTC
Jobs 1
Files 65
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

13 Nov 2024 03:30AM UTC coverage: 100.0%. Remained the same
11810101198

push

github

web-flow
Add event emitter to core Collection and refactor lifecycle hooks (#2099)

This PR adds the new events system to the collections API. This allows users to add event listeners to lifecycle hooks of any collection (modals, drawers and popovers). This update also includes a refactor of available lifecycle hooks to help the API be more concise and intuitive.

### Events API

- `on(event: string, listener: function, ...args: any[]): void`  
  Registers a listener for an event with optional additional arguments.

- `off(event: string, listenerRef: function): void`  
  Removes a specific listener from an event.

- `emit(event: string, data: any): void`  
  Triggers all listeners associated with an event, passing `data` to each.

### Updated Lifecycle Hooks

The following are the new lifecycle hooks. All previous hooks not listed here have been removed. Each hook has a corresponding event named the same unless otherwise specified. Events and hooks that directly effect an entry are provided the entry as an argument. 

**Setup Hooks**

- `beforeMount`
- `onCreateEntry` (event: `createEntry`)
- `onRegisterEntry` (event: `registerEntry`)
- `afterMount`

**Teardown Hooks**

- `beforeUnmount`
- `onDestroyEntry` (event: `destroyEntry`)
- `onDeregisterEntry` (event: `deregisterEntry`)
- `afterUnmount`

## Additional changes

- Entry API has changed in the following ways:
  - `mount()` > `init()`
  - `unmount()` > `destroy()`
- Plugins API has changed in the following ways:
  - `mount()` > `setup()`
  - `unmount()` > `teardown()`
- `getCustomProps` helper has been renamed to `buildCustomProps`.
- New helper function for handling running hooks and emitting events: `dispatchLifecycleHook()`.
- Debug plugin has been expanded to include events output and improve the visuals of logs.
- Teleport plugin now emits `teleport` and `teleportReturn` events.
- Drawer, Modal and Popover now all emit `opened` and `closed` events.
- Collect... (continued)

683 of 683 branches covered (100.0%)

Branch coverage included in aggregate %.

318 of 318 new or added lines in 28 files covered. (100.0%)

2549 of 2549 relevant lines covered (100.0%)

140.58 hits per line

Jobs
ID Job ID Ran Files Coverage
1 11810101198.1 13 Nov 2024 03:32AM UTC 0
100.0
GitHub Action Run
Source Files on build 11810101198
Detailed source file information is not available for this build.
  • Back to Repo
  • Github Actions Build #11810101198
  • 13791149 on github
  • Prev Build on next (#11801710218)
  • Next Build on next (#11902959654)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc