rich Posted April 3, 2013 Share Posted April 3, 2013 Signals are a light-weight, strongly typed messaging tool and we use them extensively in our game framework. And we’ve just released our TypeScript implementation for others to benefit from. It’s a conversion of js-signals by Miller Medeiros, which is of course in turn a conversion of AS3-Signals by Robert Penner. You can get TypeScript-Signals from github.If you are unfamiliar with Signals, how they work and how they compare to Events then this short summary is well worth a quick read, but to summarise: 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.Event string constants are no longer needed.Signals are inspired by C# events and signals/slots in Qt. I ported over all of the 18 unit tests to TypeScript as well. So you have plenty of examples: from adding a basic listener up to manual binding and dynamic context switching. http://www.photonstorm.com/archives/9826/typescript-signals-released-think-outside-the-event deis and Mike 2 Quote Link to comment Share on other sites More sharing options...
Mike Posted April 3, 2013 Share Posted April 3, 2013 That;s quite nice. It's something i needed yesterday and this is what i found yesterday: https://github.com/jonopus/typescript-signals/ Your version is a bit better version, some more types, no module, and maybe more up to date with typescript since other is 5 months, so I'm switching to yours. a little offtopic:I'm halfway trought converting the Ash entity framework from as3, and your conversion tools is really nice starting point.One thing I'm adding now is a Vector class in TypeScript which is something.Overall I'm quite enthusiastic of TypeScript future, and future codebase. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.