PackageTrack
Sign in Get early access

events_emitter

An intuitive Event-based system, inspired by NodeJS's Event Emitter. Allows for multiple data types with type safety events. Based on JavaScript and suitable for Dart and Flutter.

0.6.0 36K downloads/mo #1705 most downloaded on pub.dev DrafaKiller/EventEmitter-dart

What this package is like to depend on

Last release 2 years ago

no release in 18 months

Ships unpredictably

gaps range from 3 weeks to 2.4 years

Nearly every release is documented

notes for 23 of 23 stable releases

Nothing withdrawn

no release was ever pulled

4 years old

23 releases · first in 2022

0 releases in the last 12 months

see the full history below

Release timeline

23 releases · May 2022 to Jan 2025
2023 2024 2025 2026
Release Pre-release

Releases

latest 23
  1. 0.6.0 08 Jan 2025
    Release notes

    [!] Changed:

    • Dart SDK constraint updated from <3.0.0 to <4.0.0
    • Dependency rxdart updated from 0.27.5 to 0.28.0
    Open source →
  2. 0.5.2 26 Aug 2022
    Release notes

    Added:

    • RestrictedEventEmitter for better control by allowing or disallowing specific event types, and the max listeners limit.
    • ListCallback.args1() to get the first argument of the list in a callback, added for consistency

    Changed:

    • Data property in .emit() is optional, if no data is given the event will be of type Event<Null> which can still be caught by EventCallback<dynamic>

    Fixed:

    • Replaced lint developer dependency with lints
    Open source →
  3. 0.5.1 24 Aug 2022
    Release notes

    Added:

    • ListCallback, a helper class that when appended on .on() lets you have multiple arguments. Essentially splitting a list event Event<List<dynamic>> into arguments, it's a workaround for the fact that Dart can't handle spread syntax. See [ListCallback] documentation.
    Open source →
  4. 0.5.0 22 Aug 2022
    Release notes

    [!] Removed:

    • Redundant listener reference of itself, in EventListener callbacks: onAdd, onRemove, onCall and onCancel. For simplicity and to avoid dynamic listener's type issues. Use this if possible, or a reference of the listener instead.

    Fixed:

    • EventListener callbacks documentation
    • Main example
    Open source →
  5. 0.4.4 21 Aug 2022
    Release notes

    Added:

    • EventListener property dataType

    Fixed:

    • Improved data type validation for dynamic data
    Open source →
  6. 0.4.3 20 Aug 2022
    Release notes

    Added:

    • StreamEventListener, it's useful for having a streaming alternative to the default EventEmitter class

    Fixed:

    • Documentation with old property topic naming
    • EventListener callbacks would throw an exception in some cases when using dynamic
    Open source →
  7. 0.4.2 19 Aug 2022
    Release notes

    Added:

    • cancelAdded parameter to EventListener, tells the listener to automatically remove itself from the added EventEmitter when the .cancel() method is called. This is used in case you want to add your own canceling method. It essentially appends callbacks to the onCancel callbacks.

    • .appendCallback() method to EventListener

    [!] Changed:

    • Typedef EventAddedCallback renamed to EventCallbackAdd
    • Typedef EventRemoveCallback renamed to EventCallbackRemove
    • Typedef EventCancelCallback renamed to EventCallbackCancel

    Fixed:

    • lint dependency moved to developer dependency
    Open source →
  8. 0.4.1 19 Aug 2022
    Release notes

    Changed:

    • rxdart dependency updated from 0.27.3 to 0.27.5

    Fixed:

    • Type matching in .off()
    • [!] Positional parameters in .off() changed to named parameters, as it was intended
    Open source →
  9. 0.4.0 18 Aug 2022
    Release notes

    Added:

    • EventListener properties once and protected added
    • EventListener callbacks onAdd, onRemove and onCancel
    • EventListener handles custom events, they can also act like normal events. This is used to add context to an event if needed.
    • EventEmitter .on() can catch the data as well as the Event<T> of the data

    [!] Changed:

    • EventStreamEmitter was renamed to StreamEventEmitter
    • Event property topic renamed to type, to match JavaScript events
    • Event property message renamed to data
    • StreamEventEmitter's stream controller is now public

    [!] Removed:

    • EventEmitter sync
    • EventListener property stream, subscription and messageType

    Massive BREAKING CHANGES:

    • EventEmitter was refactored to not depend on Streams, which means it now manages the callbacks itself. The emitter can have more complex listener logic. Before it would depend on StreamEventEmitter.

    • File structure was changed to be more organized. This means you might need to update your imports.

    • Sync is no longer a thing in the EventEmitter, it's a StreamEventEmitter only thing now.

    • Other changes: [!]

    Open source →
  10. 0.3.1 08 Jun 2022
    Release notes

    Added:

    • shield.io badges

    Changed:

    • ChangeLog's format
    Open source →
  11. 0.3.0 24 May 2022
    Release notes

    Changed:

    • .onAny in EventEmitter now returns an EventListener

    Fixed:

    • In some cases, canceled listeners didn't get removed, now it's more accurate
    Open source →
  12. 0.2.1 23 May 2022
    Release notes

    Fixed:

    • Make package only dart dependant
    Open source →
  13. 0.2.0 22 May 2022
    Release notes

    Added:

    • .emitEvent() emits an existing event, without having to create a new one
    Open source →
  14. 0.1.0 20 May 2022
    Release notes

    Added:

    • rxdart package dependency, for better-implemented streams

    Fixed:

    • Cast with dynamic type would break unexpectedly
    Open source →
  15. 0.0.7 20 May 2022
    Release notes

    Fixed:

    • .onAny return type (Still has errors)
    Open source →
  16. 0.0.6 20 May 2022
    Release notes

    Changed:

    • Filter .onAny<T>() by type

    Fixed:

    • pubspec.yaml clean up
    • Example with final
    Open source →
  17. 0.0.5 19 May 2022
    Release notes

    Changed:

    • once in EventEmitter now returns a Future with the message, allowing to await (still needs a callback)
    • Separated EventEmitter and EventStreamEmitter classes into different files
    • Internal variable names for simplification

    Removed:

    • send for simplification, the same could be achieved with emit
    Open source →
  18. 0.0.5+1 19 May 2022
    Release notes

    Added:

    • More documentation (Why is this package different?)

    Fixed:

    • Documentation typos
    Open source →
  19. 0.0.5+2 19 May 2022
    Release notes

    Changed:

    • Package description and documentation for type safety promotion
    Open source →
  20. 0.0.4 18 May 2022
    Release notes

    Removed:

    • Package dependency flutter_lints
    Open source →
  21. 0.0.3 18 May 2022
    Release notes

    Fixed:

    • StreamSubscription, cancel instances
    Open source →
  22. 0.0.2 18 May 2022
    Release notes

    Changed:

    • on to return an EventListener, instead of a StreamSubscription

    Fixed:

    • Package description (was too long)
    Open source →
  23. 0.0.1 18 May 2022
    Release notes

    Initial release: EventEmitter

    Open source →

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive