Typescript Pub/Sub Library inspired by QT signals/slots
TypeScriptMPL-2.0
ts-signals
NOTE: This project is not actively maintained
Concept
A Signal is essentially a mini-dispatcher specific to one event, with its own array of listeners.
A Signal gives an event a concrete membership in a class.
Listeners subscribe to real objects, not to string-based channels.
Signals are inspired by C# events and signals/slots in Qt.
Example
interfacePhoto{name : String;url : String;}interfacePhotoAlbum{thumbnailClick : TypedSignal<Photo>;}interfacePhotoFrame{show(photo : Photo);}// displays a photo in a frame when the thumbnail is clickedphotoAlbum.thumbnailClick.add(photo=>photoFrame.show(photo));