Strongly Typed Events

Strongly Typed Events

Add the power of events to your projects. We even have 3 flavors for you!

This project gives you the following event types:

  • Events – styled after the way .Net implements events. With each event you’ll get a sender and an argument object. If you use typescript, you can implement them using generics. npm install ste-events --save
  • Simple events – basically the same thing, with only an argument. npm install ste-simple-events --save
  • Signals – for when no data is needed, just the firing of the event is enough: npm install ste-signals --save
  • You want them all? Just use npm install strongly-typed-events --save.
Using strongly typed events in TypeScript with interfaces (Part 2)
Using strongly typed events in TypeScript with interfaces (Part 2)
Strongly Typed Events, TypeScript

Using strongly typed events in TypeScript with interfaces (Part 2)

In a previous tutorial I explained how events can be implemented as properties on a class using Strongly Typed Events for TypeScript. Let’s explore how these work on interfaces. Interfaces work a little different, because they don’t have getters and setters on them (at least nog in TypeScript 1.8). Let’s explore how these work on interfaces.