I was cleaning some code of mine yesterday, when I came across a solution for a common AS3Signal problem which I hadn’t even registering at the time.
One of the great things about Signals is the way you can declare the value types that will be dispatched, the example below shows a strictly-typed signal, and its implementation.
This has the advantage of throwing errors if the types dispatched do not match, but the disadvantages of having no code-hinting on the generic dispatch method. I spend quite a lot of time having to navigate back to the original strictly-typed Signal to check its value-classes.
By simply adding a method that wraps the generic dispatch method, you can strictly-type the dispatch call, and thus get code-hinting:
As you can see, this means loosing the interface and casting to type. However if you (like me) are using DI, you will probably be injecting strictly anyway.