Skip to content

Instantly share code, notes, and snippets.

@thisisjofrank
Created April 22, 2022 13:21
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/8fe1419359865d947b6076bbe4a45966 to your computer and use it in GitHub Desktop.
Save thisisjofrank/8fe1419359865d947b6076bbe4a45966 to your computer and use it in GitHub Desktop.
swarm.onElection = (channel: Types.RealtimeChannelPromise) => {
leaderUi.innerText = "true";
setInterval(() => {
counter++;
channel.publish("message", { counter: counter });
console.log("Sent counter", counter);
}, 5000);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment