You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[](https://github.com/prettier/prettier)
11
11
12
-
TypeScript port of [AS3 Signals](https://github.com/robertpenner/as3-signals).
13
-
[13kb compressed](dist/signals.min.js).
12
+
**SignalsJS** is a [TypeScript](https://www.typescriptlang.org/) port of [AS3 Signals](https://github.com/robertpenner/as3-signals).
13
+
[15KB compressed](dist/signals.min.js).
14
+
15
+
About
16
+
---
17
+
18
+
**Signals** are light-weight, strongly-typed messaging tools.
19
+
Wire your application with better APIs and less boilerplate than normal event systems.
20
+
21
+
Concept
22
+
---
23
+
24
+
* A **Signal** is essentially a mini-dispatcher specific to one event, with its own array of listeners.
25
+
* A **Signal** gives an event a concrete membership in a class.
26
+
* Listeners subscribe to real objects, not to string-based channels.
27
+
* Event string constants are no longer needed.
28
+
***Signals** was originally implemented by [Robert Penner](https://github.com/robertpenner) in [AS3](https://github.com/robertpenner/as3-signals).
29
+
***Signals** are inspired by [C# events](http://en.wikipedia.org/wiki/C_Sharp_syntax#Events) and [signals/slots](http://en.wikipedia.org/wiki/Signals_and_slots) in Qt.
30
+
31
+
Syntax
32
+
---
33
+
34
+
```typescript
35
+
// with DOM EventListener
36
+
button.addEventListener("click", onClick);
37
+
38
+
// Signal equivalent; past tense is recommended
39
+
button.clicked.add(onClicked);
40
+
```
41
+
42
+
Installation
43
+
---
44
+
45
+
You can get the latest release and the type definitions using [NPM](https://www.npmjs.com/):
0 commit comments