Skip to content

Commit 896b18b

Browse files
committed
Rename to remove Typed from names for RC.3
1 parent b5f09d0 commit 896b18b

File tree

9 files changed

+345
-150
lines changed

9 files changed

+345
-150
lines changed

CHANGELOG.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,24 @@ and this project adheres to [Semantic Versioning].
66

77
## [3.0.0] - 2021-??-??
88
### Added
9-
- `PublicTypedEvent`: Same as <= v2 `Event`.
9+
- `PublicEvent`: Same as <= v2 `Event`.
1010
- This can be used as a drop in replacement for the previous `Event` class
1111
when upgrading with no additional work.
12-
- `TypedEvent` also added, but lacks an `emit` member function.
13-
- This is intended to be the "main" event class going forward.
1412
- `createEventEmitter()` is the new "main" method going forward to handle most
1513
events. See docs for use.
1614
- See [#14].
1715
- `createPublicEventEmitter()` also added a matching API, but with
18-
`PublicTypedEvent` events instead.
16+
`PublicEvent` events instead.
1917

2018
### Changes
2119
- `events` fully removed.
2220
- See [#8] for discussion and alternatives when upgrading.
23-
- `Event` replaced with `PublicTypedEvent` and `TypedEvent` listed above.
21+
- `Event` replaced with `PublicEvent` and `Event` listed above.
22+
- This is intended to be the "main" event class going forward, but never
23+
created directly.
24+
- `emit` removed, use `PublicEvent` as a drop-in replacement.
25+
- Constructing via `new` is no longer supported, and marked as such in the TS
26+
definitions.
2427
- Exports changed to the new functions/classes/types.
2528

2629
### Fixed
@@ -43,7 +46,7 @@ and this project adheres to [Semantic Versioning].
4346

4447
## [1.1.1] - 2018-01-05
4548
### Changes
46-
- Update package dependencies to resolve marked v0.3.6 security vunerability
49+
- Update package dependencies to resolve marked v0.3.6 security vulnerability
4750
- Correct the names of some tests with poor grammar/spelling
4851

4952
## [1.1.0] - 2017-12-31

README.md

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
Strongly typed event emitters for [TypeScript](https://www.typescriptlang.org/).
44

55
This is a TypeScript project, although the compiled source is available in the
6-
npm package, it is solely designed around the purpose of making events easier to
7-
work with _in TypeScript_.
6+
npm package without any runtime dependencies, it is solely designed around the
7+
purpose of making events easier to work with _in TypeScript_ via the included
8+
definitions.
89

910
## Purpose
1011

@@ -26,28 +27,28 @@ build blocks in this library so you can use it best works in your project.
2627
import { createEventEmitter } from "ts-typed-events";
2728
```
2829

29-
### Simple Usage
30+
### Simple usage
3031

3132
```ts
32-
const { event, emit } = createEventEmitter<string>();
33+
const { event, emit } = createEventEmitter();
3334

34-
event.on((str) => {
35-
console.log("hey we got the string:", str);
35+
signal.on(() => {
36+
console.log("The event triggered!");
3637
});
3738

38-
emit("some string"); // prints `hey we got the string: some string`
39+
emit(); // prints: `The event triggered!`
3940
```
4041

41-
### Events without types (signals)
42+
### Strongly typed events
4243

4344
```ts
44-
const { event: signal, emit } = createEventEmitter<string>();
45+
const { event, emit } = createEventEmitter<string>();
4546

46-
signal.on(() => {
47-
console.log("The event triggered!");
47+
event.on((str) => {
48+
console.log("hey we got the string:", str);
4849
});
4950

50-
emit(); // prints: `The event triggered!`
51+
emit("some string"); // prints `hey we got the string: some string`
5152
```
5253

5354
### async/await usage

0 commit comments

Comments
 (0)