v1.0.1
v1.0.1
- Clean
registerSocketForUser
method- Add
extractUserId
method (private): Parses and validatesuserId
from incoming data, throwing an error ifuserId
is missing. - Add
handleExistingConnection
method (private): Checks and disconnects existing sockets for a user, ensuring only one active connection. - Add
saveUserSocketsToRedis
method (private): Manages Redis persistence of active user sockets, updating data after each connection change.
- Add
- Add jsdoc comments to all methods
- Add example in class documentation
- Shortened public method names for simplicity:
initializeUserSockets
is nowinitialize
getUserSockets
is nowgetSockets
getUserSocket
is nowgetSocket
registerSocketForUser
is nowregister
deRegisterSocketForUser
is nowderegister
informSocket
remains asinform
- Deprecated: Original method names remain for backward compatibility but will be removed in future versions. Using these names now triggers a warning.
- Add missing use of
initialize
method
What's Changed
- docs: add history by @IamLizu in #2
- Refactor/clean code by @IamLizu in #6
- docs: add js doc and example in class by @IamLizu in #7
- refactor: simplify methods and add deprecated warning for old methods by @IamLizu in #8
- docs: add missing instruction step for
initialize
by @IamLizu in #9
Full Changelog: v1.0.0...v1.0.1