Releases: Dashlane/ts-event-bus
v4.2.0
v4.1.1
- Fix a regression on the createEventBus return type introduced in the previous version
v4.1.0
- Add ignoredEvents list to
createEventBus
which allow the local end off the connector to not listen to the events from the ignore list.
v3.1.0
- remove parameters limit for combineEvents
v3.0.0
BREAKING CHANGE FROM CONSUMER POINT OF VIEW
Rework library's build:
- Remove webpack
- Transpile src to JavaScript using babel-preset-typescript + babel-preset-env
- Add "active"/"modern" browserslist config
- Transform JavaScript closest to our browser targets using bugfixes option
- Transpile individual source files instead of bundling
- Migrate unit tests from mocha/should/sinon to Jest
- Upgrade all dev dependencies
- Improve package's scripts:
Thanks @ziir
v2.1.3
2.1.3
v2.1.2
Fix slot config override issue
v2.1.0
Parametric and Lazy slots, noBuffer option
-
Introducing the concept of parametric slot:
-
A new "param" argument on
trigger
and.on
allows us to send data through a slot for a specific parameter withslot(<param>, <data>)
, and reciprocally to listen to a specific parameter withslot.on(<param>, <data>)
.
Lazy callbacks are now called for each parameter separately: connect is called with param as argument the first time someone connects somewhere with.on(<param>, ...)
and same thing for disconnect. -
If this first parameter is skipped, then a default parameter is used. This help us when the slot has no need for such a parameter and for retro-compatibility concerns.
-
-
Introducing the concept of
lazy
slot: slots expose alazy
method that will allow you to call a "connect" callback when a first client connects to the slot, and a "disconnect" callback when the last client disconnect. Remote or local clients are considered equally. If a client was already connected to the slot at the time whenlazy
is called, the "connect" callback is called immediately. -
Introducing the
noBuffer
config option on a slot: with this option setup, slots won't wait for all remote handlers to be connected before triggering anymore. -
Fixing
combineEvents
: we come back to previous implementation. The newest one required that the combined event declarations all had the same type, which is not the point. We are also now throwing when encountering duplicate event declarations. -
Renaming
FAKE_SLOT
->notConnectedSlot
as there is nothing fake, and I found the name a bit misleading, particularly when this slot now holds the slot config prior to connection.
v2.0.0
BREAKING CHANGES
GenericChannel
now has a dedicated constructor which accepts an optional timeout argument that defaults to5000ms
GenericChannel
's_timeout
is now private, and atimeout getter
is available
v1.0.3
1.0.3