Jump to content

TypeScript Signals released


rich
 Share

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...