Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[🚀esl-event-listener]: add a group property to event descriptor type #2381

Closed
ala-n opened this issue May 2, 2024 · 2 comments · Fixed by #2386
Closed

[🚀esl-event-listener]: add a group property to event descriptor type #2381

ala-n opened this issue May 2, 2024 · 2 comments · Fixed by #2386

Comments

@ala-n
Copy link
Collaborator

ala-n commented May 2, 2024

As a consumer of ESL EventListener, I want to have the capability to unsubscribe and resubscribe from a list of subscriptions.

While our API offers a robust and efficient means to filter subscriptions — allowing subscription, unsubscription, and resubscription by descriptor filter — we've overlooked a common use case: users often have a set of related functionalities with associated listeners. Consequently, there's a frequent need to consistently resubscribe to these listeners, even if the grouping itself lacks any technical correlation.

To address this, proposing to introduce a group property (even without additional behaviour) that allows users to effectively manage event listeners within groups.

@listen ({ event: 'event1' , group: 'group' } )
_onEvent1 () {}

@listen ({ event: 'event2' , group: 'group' } )
_onEvent2 () {}

// to unsubscribe we can use:
this.$$off({group: 'group'});
@ala-n ala-n added the waits triage Issue that waits to be reviewed and handled label May 2, 2024
@ala-n ala-n added this to the âš¡ESL: 4.17.0 Major release milestone May 2, 2024
@ala-n ala-n added feature New feature and removed waits triage Issue that waits to be reviewed and handled labels May 7, 2024
@ala-n ala-n self-assigned this May 7, 2024
ala-n added a commit that referenced this issue May 7, 2024
ala-n pushed a commit that referenced this issue May 21, 2024
## [5.0.0-beta.17](v5.0.0-beta.16...v5.0.0-beta.17) (2024-05-21)

### Features

* **esl-event-listener:** add a `group` key to process batch subscription operations ([3d1ece0](3d1ece0)), closes [#2381](#2381)
* **esl-event-listener:** rework and make warnings of event listener system with more strict and truthful detection of a problem ([f6fd40b](f6fd40b))
* **esl-event-listener:** update listener internal mechanics to store and collect descriptors (with ability to filter them) ([48bf06a](48bf06a))
* **esl-media:** add ability to provide video initial position (start time) ([7367bb7](7367bb7))
* **esl-utils:** add ability to reject promisifyEvent by using AbortSignal ([b49da0e](b49da0e))

### Bug Fixes

* **esl-event-listener:** `ESLEventUtils.descriptors` api notes correction ([309c130](309c130))
* **esl-event-listener:** fix re-subscription when condition is used ([b304c52](b304c52))
* **esl-media:** add exact element resize observation reduce; extra subscriptions manipulation ([7e58bbd](7e58bbd))
* **esl-media:** seekTo leads to no proper behavior when YouTube video is not ready ([f5a0762](f5a0762))
* **esl-popup:** fix it is not possible to set the offset-arrow to 0 ([c6f1a9f](c6f1a9f))
* **esl-utils:** fix parseNumber signature (undefined when default provided) ([647b736](647b736))
@ala-n
Copy link
Collaborator Author

ala-n commented May 21, 2024

🎉 This issue has been resolved in version 5.0.0-beta.17 🎉

The release is available on:

Your semantic-release bot 📦🚀

ala-n pushed a commit that referenced this issue May 31, 2024
# [4.17.0](v4.16.0...v4.17.0) (2024-05-31)

### Bug Fixes

* **deps:** bump pug from 3.0.2 to 3.0.3 ([8006a45](8006a45))
* **deps:** bump puppeteer from 22.9.0 to 22.10.0 ([d82fa11](d82fa11))
* **esl-animate:** fix handling of `esl-animate-mixin` attribute changes ([0bb3a44](0bb3a44))
* **esl-event-listener:** `ESLEventUtils.descriptors` api notes correction ([309c130](309c130))
* **esl-event-listener:** fix `listen` decorator strict types are incorrect ([94c85f2](94c85f2))
* **esl-event-listener:** fix re-subscription when condition is used ([b304c52](b304c52))
* **esl-media:** add exact element resize observation reduce; extra subscriptions manipulation ([7e58bbd](7e58bbd))
* **esl-media:** fix missing reinitialization on start-time attribute changing ([e5922ed](e5922ed))
* **esl-media:** fix TSX shape for supporting start-time attribute ([1f43a22](1f43a22))
* **esl-media:** play-in-viewport tolerance changed to 50% (75% before) ([06d2a13](06d2a13))
* **esl-media:** seekTo leads to no proper behavior when YouTube video is not ready ([f5a0762](f5a0762))
* **esl-panel:** fix the falsy state of animation in the default open panel in esl-panel-group ([64925e0](64925e0))
* **esl-popup:** fix it is not possible to set the offset-arrow to 0 ([c6f1a9f](c6f1a9f))
* **esl-utils:** fix event cancellation handling ([8e45a75](8e45a75))
* **esl-utils:** fix isRelativeNode signature (can accept undefined as a node) ([4e2c7af](4e2c7af))
* **esl-utils:** fix parseNumber signature (undefined when default provided) ([647b736](647b736))
* **site:** `esl-animate` example page wrong animation ([7fd86b4](7fd86b4))

### Features

* **esl-event-listener:** add a `group` key to process batch subscription operations ([3d1ece0](3d1ece0)), closes [#2381](#2381)
* **esl-event-listener:** rework and make warnings of event listener system with more strict and truthful detection of a problem ([f6fd40b](f6fd40b))
* **esl-event-listener:** separate intersection events ([370d33b](370d33b))
* **esl-media:** add ability to provide video initial position (start time) ([7367bb7](7367bb7))
* **esl-popup:** add handler for refresh event ([5864c92](5864c92))
* **esl-utils:** add ability to reject promisifyEvent by using AbortSignal ([b49da0e](b49da0e))
* **esl-utils:** add provider function support into `[@prop](https://github.com/prop)` decorator ([9f4bfbe](9f4bfbe))
* **esl-utils:** add the ability to use additional attributes in `loadScript` utility ([#2279](#2279)) ([f803226](f803226))
* **esl-utils:** make DelegatedEvent equal too `DelegatedEvent<Event>`, fix types compatibility ([#2360](#2360)) ([458ea53](458ea53))
* **lint:** add deprecation warning regarding incorrect direct imports for `attr`, `prop`, `jsonAttr`, `boolAttr`, `listen` ([e592048](e592048))
@ala-n
Copy link
Collaborator Author

ala-n commented May 31, 2024

🎉 This issue has been resolved in version 4.17.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@ala-n ala-n added the released label May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant