Created
December 2, 2019 14:32
-
-
Save ngohungphuc/ebfde419e819977604f38e248baf8b3f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
initService() { | |
const conn = (navigator as any).connection; | |
if (conn) { | |
if (conn.saveData) { | |
// do something | |
} | |
const connectionlist = ["slow-2g", "2g", "3g", "4g"]; | |
const effectiveType = conn.effectiveType; | |
console.log(effectiveType); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment