Skip to content

Instantly share code, notes, and snippets.

@thisisjofrank
Created April 22, 2022 13:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thisisjofrank/37e6228e16e44900519e1ef6c168a780 to your computer and use it in GitHub Desktop.
Save thisisjofrank/37e6228e16e44900519e1ef6c168a780 to your computer and use it in GitHub Desktop.
Next we define some properties to store callbacks. When connection and election events occur, we'll call the appropriate callback to allow the application to trigger an appropriate action:
public onElection: (channel: Types.RealtimeChannelPromise) => void = () => {};
public onConnection: (channel: Types.RealtimeChannelPromise) => void = () => {};
public onSwarmPresenceChanged: (members: Types.PresenceMessage[]) => void = () => {};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment