Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaly-t committed Sep 29, 2024
1 parent c3a493f commit 4ae6ab3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sub-events",
"version": "2.0.0-beta.1",
"version": "1.10.0",
"description": "Lightweight, strongly-typed events, with monitored subscriptions.",
"main": "dist/src/index.js",
"types": "dist/src/index.d.ts",
Expand Down
5 changes: 3 additions & 2 deletions src/event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,8 @@ export class SubEvent<T = unknown> {
/**
* Last emitted event, if there was any, or `undefined` otherwise.
*
* It is set after all subscribers have received the event.
* It is set after all subscribers have received the event, but just before
* optional {@link IEmitOptions.onFinished} callback is invoked.
*/
get lastEvent(): T | undefined {
return this._lastEvent;
Expand Down Expand Up @@ -377,10 +378,10 @@ export class SubEvent<T = unknown> {
}
if (index === r.length - 1) {
// the end of emission reached;
this._lastEvent = data; // save the last event
if (onFinished) {
onFinished(r.length); // notify
}
this._lastEvent = data; // save the last event
}
}));
});
Expand Down
2 changes: 1 addition & 1 deletion typedoc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://typedoc.org/schema.json",
"name": "SUB-EVENTS v2.0.0-beta.1",
"name": "SUB-EVENTS v1.10.0",
"out": "./docs",
"excludeExternals": true,
"excludePrivate": true,
Expand Down

0 comments on commit 4ae6ab3

Please sign in to comment.