utilium 1.1.2 → 1.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/list.d.ts +4 -1
- package/dist/list.js +1 -0
- package/package.json +1 -1
- package/src/list.ts +8 -1
package/dist/list.d.ts
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
import { EventEmitter } from 'eventemitter3';
|
2
|
-
export declare class List<T> extends EventEmitter<
|
2
|
+
export declare class List<T> extends EventEmitter<{
|
3
|
+
update: [];
|
4
|
+
add: [T];
|
5
|
+
}> implements RelativeIndexable<T> {
|
3
6
|
readonly [Symbol.toStringTag] = "List";
|
4
7
|
constructor(values?: readonly T[] | Iterable<T> | null);
|
5
8
|
protected data: Set<T>;
|
package/dist/list.js
CHANGED
package/package.json
CHANGED
package/src/list.ts
CHANGED
@@ -1,6 +1,12 @@
|
|
1
1
|
import { EventEmitter } from 'eventemitter3';
|
2
2
|
|
3
|
-
export class List<T>
|
3
|
+
export class List<T>
|
4
|
+
extends EventEmitter<{
|
5
|
+
update: [];
|
6
|
+
add: [T];
|
7
|
+
}>
|
8
|
+
implements RelativeIndexable<T>
|
9
|
+
{
|
4
10
|
public readonly [Symbol.toStringTag] = 'List';
|
5
11
|
|
6
12
|
public constructor(values?: readonly T[] | Iterable<T> | null) {
|
@@ -101,6 +107,7 @@ export class List<T> extends EventEmitter<'update'> implements RelativeIndexable
|
|
101
107
|
public add(value: T): this {
|
102
108
|
this.data.add(value);
|
103
109
|
this.emit('update');
|
110
|
+
this.emit('add', value);
|
104
111
|
return this;
|
105
112
|
}
|
106
113
|
|