Skip to content

Instantly share code, notes, and snippets.

@oney
Last active June 3, 2022 08:55
Show Gist options
  • Save oney/f65e3f82e1382c656179882e65d1d4a6 to your computer and use it in GitHub Desktop.
Save oney/f65e3f82e1382c656179882e65d1d4a6 to your computer and use it in GitHub Desktop.
// ...
socket.on('connected', async () => {
await checkConnection(selectedRoom);
showToast(theme, 'Connected to ' + connectedRoom);
// I just want to call showToast with one line
// Why I must define a new callback with 3 lines
// of code outside of effect?? 🤨
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment