Skip to content

Latest commit

 

History

History
130 lines (99 loc) · 8.43 KB

File metadata and controls

130 lines (99 loc) · 8.43 KB

History

Version 3.0

Solved dependency problems when using ViteJs (#269).

Version 2.1

It is now possible to subscribe to onSubscriptionChange on all dispatchers; this allows you to monitor a change in subscriptions. Both onSubscriptionChange and asEvent are (now) lazy loading.

Methods that will trigger a change: subscribe, sub, unsubcribe, unsub, one and sometimes dispatch (after a one trigger is dispatched and that trigger is removed).

Version 2.0

Better support for code splitting. All objects now recide in their own class, which makes splitting and tree shaking easier and should produce smaller packages.

New features:

We now have the following packages:

Package Description
ste-core Package that contains all the building blocks for the creation of events. The dispatcher implementation is its main hero.
ste-events or ste-promise-events Events that are modeled after .Net with a sender and argument. If you use typescript, you can leverage the support for generics and get strongly typed code.
ste-simple-events or ste-promise-simple-events A simpler version of the ste-event-event. No sender, just an argument.
ste-signals or ste-promise-signals A signal is even simpler, it is just a callback for when you need to be alerted without any scope.
strongly-typed-events This package includes everything.
ste-browser Helps to host events in the browser.

Version 1.7

Added browser support for the individual flavors of events:

<script src="https://cdn.jsdelivr.net/npm/ste-browser@latest/dist/ste-events.js"></script>
<script src="https://cdn.jsdelivr.net/npm/ste-browser@latest/dist/ste-events.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/ste-browser@latest/dist/ste-simple-events.js"></script>
<script src="https://cdn.jsdelivr.net/npm/ste-browser@latest/dist/ste-simple-events.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/ste-browser@latest/dist/ste-signals.js"></script>
<script src="https://cdn.jsdelivr.net/npm/ste-browser@latest/dist/ste-signals.min.js"></script>

Version 1.6

@DustinWoods added support for non uniform event lists.

Version 1.5

Added support for subscription .count from the dispatcher.

Version 1.4

Added support for UMD for the ste-browser package.

Version 1.3

We transformed the single package to 5 packages:

Package Description
ste-core Package that contains all the building blocks for the creation of events. The dispatcher implementation is its main hero.
ste-events Events that are modeled after .Net with a sender and argument. If you use typescript, you can leverage the support for generics and get strongly typed code.
ste-simple-events A simpler version of the ste-event-event. No sender, just an argument.
ste-signals A signal is even simpler, it is just a callback for when you need to be alerted without any scope.
strongly-typed-events This package includes everything.

Version 1.2

Added ev.stopPropagation and ev.unsub() to aid in event management. Each event type has an extra parameter that can be used to manage the event:

//log the name of the clock and the tick argument to the console - this is an event
clock.onClockTick.subscribe((c, n, ev) =>

  console.log(`${c.name} ticked ${n} times.`)

  //stop further event propagation:
  ev.stopPropagation();

  //unsubscribes the event handler that caused the event:
  ev.unsub();
);

Version 1.1

Removed the static. Internal restructuring of the package. Removed default exports, all exports are now named. This is a breaking change. An unsubscribe function is now returned when registering a subscription: let unsub = x.sub(x => {}); unsub();.

Version 1.0

Added default exports. Removed emulation through window.

Version 0.5

Restructured includes for 'normal' web applications. Using import / export mechanisme. Emulating exports and require nodes through the window object for web.

Version 0.4

Introduced the one method on events to subscribe only once. Added sub and unsub methods as shorthands for subscribe and unsubscribe. Added a has method to check if a handler has been registered. Now supports Node.js through npm package: npm i strongly-typed-events. Rewrote and split tests.
0.4.2: Introduced the clear method on events to clear all subscriptions.

Version 0.3

Introduced signal – events that contain no data and just fire. The unit tests now support modules. The following objects and features are present in this version:

  • ISignal – Event handler function for a signal.
  • SignalDispatcher – Dispatcher implementation for signals. Can be used to subscribe, unsubscribe or dispatch events. Use the ToEvent() method to expose the event.
  • SignalList – Storage class for multiple signals that are accessible by name. Dispatchers are automatically created.
  • SignalHandlingBase – Extends objects with signal handling capabilities.

Version 0.2

Introduced simple events – events that only use an arguments object. I've added many base classes and interfaces to make sure the base for both type of events are the same. The following objects and features are present in this version:

  • ISimpleEvent<TArgs> – Event handler function with a generic argument.
  • SimpleEventDispatcher<TArgs> – Dispatcher implementation for simple events. Can be used to subscribe, unsubscribe or dispatch events. Use the ToEvent() method to expose the event
  • SimpleEventList<TArgs> – Storage class for multiple events that are accessible by name. Events dispatchers are automatically created.
  • SimpleEventHandlingBase<TArgs> – Extends objects with simple event handling capabilities.
  • Added an asEvent method to the dispatchers that will expose only the subsribe / unsubscribe methods. This will prevent the dispatch method from being exposed through the events.
  • Added an dispatchAsync method to the dispatchers that will execute all subsriptions asynchronously. Check this for more information.

Version 0.1

Introducing the events - use a generic sender and a generic argument to dispatch events through your projects. The following objects and features are present in this version:

  • IEvent<TSender, TArgs> – Event handler function with a generic sender and a generic argument.
  • EventDispatcher<TSender, TArgs> – Dispatcher implementation for events. Can be used to subscribe, unsubscribe or dispatch events. Use the ToEvent() method to expose the event.
  • EventList<TSender, TArgs> – Storage class for multiple events that are accessible by name. Events dispatchers are automatically created.
  • EventHandlingBase<TSender, TArgs> – Extends objects with event handling capabilities.