-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🪲 FIX(NOTION-115): Re-subscribe when internet connection is lost and …
…regained #33
- Loading branch information
1 parent
4a87041
commit 43a8462
Showing
10 changed files
with
179 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { Subscription, Subscriptions } from "../types/subscriptions"; | ||
|
||
export class SubscriptionManager { | ||
private _subscriptions: Subscriptions = {}; | ||
|
||
public get(): Subscriptions { | ||
return this._subscriptions; | ||
} | ||
|
||
public toList(): Subscription[] { | ||
return Object.values(this._subscriptions); | ||
} | ||
|
||
public add(subscription: Subscription): void { | ||
this._subscriptions[subscription.id] = subscription; | ||
} | ||
|
||
public remove(subscription: Subscription): void { | ||
if (!(subscription.id in this._subscriptions)) { | ||
return; | ||
} | ||
|
||
Reflect.deleteProperty(this._subscriptions, subscription.id); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.