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** 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.
29
+
30
+
Syntax
31
+
---
32
+
33
+
```typescript
34
+
// with DOM EventListener
35
+
button.addEventListener("click", onClick);
36
+
37
+
// Signal equivalent; past tense is recommended
38
+
button.clicked.add(onClicked);
39
+
```
40
+
41
+
Installation
42
+
---
43
+
44
+
You can get the latest release and the type definitions using [NPM](https://www.npmjs.com/):
0 commit comments