Skip to content
This repository has been archived by the owner on Jan 24, 2023. It is now read-only.

Commit

Permalink
Enforce singleton pattern for MySky
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcnski committed Dec 21, 2021
1 parent 8962ba9 commit 271608f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/mysky/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,10 @@ export class MySky {
protected hostDomain: string,
protected currentPortalUrl: string
) {
if (MySky.instance) {
throw new Error("Trying to create a second MySky instance");
}

this.pendingPermissions = permissions;
}

Expand Down

0 comments on commit 271608f

Please sign in to comment.