-
-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature network connection #26
Feature network connection #26
Conversation
|
||
globalThis.addEventListener('online', onlineOfflineHandler); | ||
globalThis.addEventListener('offline', onlineOfflineHandler); | ||
globalThis?.navigator.connection.addEventListener('change', networkChangeHandler); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of navigator, add ? before connection.
return () => { | ||
globalThis.removeEventListener('online', onlineOfflineHandler); | ||
globalThis.removeEventListener('offline', onlineOfflineHandler); | ||
globalThis.navigator.connection.removeEventListener('change', networkChangeHandler); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add ? before connection
Signed-off-by: Himanshu Gupta <opensrc0@gmail.com>
🎉 This PR is included in version 1.2.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
📝 Description
⛳️ Current behavior (updates)
🚀 New behavior
💣 Is this a breaking change (Yes/No):
📝 Additional Information