Class

SessionChannel

SessionChannel(channelName, onSessionExpired, onSessionCreated, onLeadershipRequested)

Manages inter-tab communication using the BroadcastChannel API.
Constructor

# new SessionChannel(channelName, onSessionExpired, onSessionCreated, onLeadershipRequested)

Parameters:
Name Type Description
channelName string The name of the broadcast channel.
onSessionExpired Callback Callback invoked when the session has expired.
onSessionCreated Callback Callback invoked when a session is created.
onLeadershipRequested Callback Callback invoked when a leadership request is received.

View Source lib/events/SessionChannel.ts, line 12

Classes

SessionChannel

Methods

# post(msg)

Sends a message via the broadcast channel to inform other tabs of session changes.
Parameters:
Name Type Description
msg BroadcastMessage The messsage to broadcast.

View Source lib/events/SessionChannel.ts, line 89