Skip to content

Commit

Permalink
Merge pull request #40 from newfrgmnt/connection-disposal-fix
Browse files Browse the repository at this point in the history
Use optional chain in dispose of Connection
  • Loading branch information
emilwidlund authored Sep 14, 2023
2 parents 795f065 + 1c2beed commit 2ff6702
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nodl/core",
"version": "1.0.6",
"version": "1.0.7",
"description": "Core implementation of the Nodl framework",
"main": "build/index.js",
"author": "Emil Widlund",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/Connection/Connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export class Connection<T> extends Subject<T> {
/** Disposes the Connection */
public dispose() {
this.unsubscribe();
this.subscription.unsubscribe();
this.subscription?.unsubscribe();

this.from.connections = this.from.connections.filter(connection => connection !== this);
this.to.connection = null;
Expand Down

0 comments on commit 2ff6702

Please sign in to comment.