-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: prefix socket events with a context
adds a prefix to all socketevents to provide a context. this is a preparation to add more event types in the future, like "error" or "emit", besides "data" events BREAKING CHANGE: this breaks compatibility with previous versions. make sure to upgrade both client and server
- Loading branch information
1 parent
ddaab01
commit bb89f10
Showing
5 changed files
with
214 additions
and
148 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
export const DATA_CONTEXT = 'data' as const; | ||
|
||
export const SOCKET_EVENTS = { | ||
data: { | ||
clientUpdate: `${DATA_CONTEXT}:update`, | ||
requestSubscription: `${DATA_CONTEXT}:subscribe`, | ||
requestKeysSubscription: `${DATA_CONTEXT}:subscribeKeys`, | ||
requestUnsubscription: `${DATA_CONTEXT}:unsubscribe`, | ||
}, | ||
} as const; |
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
Oops, something went wrong.