Giter Site home page Giter Site logo

react-internet-meter's Introduction

react-internet-meter

Notify on internet speed changes

In later version default image will be removed. It is recommended to give address of image on your server/s. As it will give you more usefull and reliable values.

NPM JavaScript Style Guide

How it work ?

untitled-project_MBDXODJs_itmf

Install

npm  install --save react-internet-meter

Usage

import React from 'react'

import { ReactInternetSpeedMeter } from 'react-internet-meter'
import 'react-internet-speed-meter/dist/index.css'

const App = () => {
       <ReactInternetSpeedMeter  
            txtSubHeading="Internet is too slow"
            outputType="alert"
            customClassName={null}
            txtMainHeading="Opps..." 
            pingInterval={4000} // milliseconds 
            thresholdUnit='megabyte' // "byte" , "kilobyte", "megabyte" 
            threshold={100}
            imageUrl="https://res.cloudinary.com/dcwxsms2l/image/upload/v1610376487/pexels-ivan-samkov-6291574_bzqgps.jpg"
            downloadSize="1781287"  //bytes
            callbackFunctionOnNetworkDown={(speed)=>console.log(`Internet speed is down ${speed}`)}
            callbackFunctionOnNetworkTest={(speed)=>setwifiSpeed(speed)}
          />
}

export default App
Parameter Type Options
txtSubHeading string any string you want
outputType string "alert"/"modal"/"empty"
customClassName string css class you want
txtMainHeading string any string you want
pingInterval integer time in milliseconds
thresholdUnit string "byte"/"kilobyte"/"megabyte"
threshold Integer Minimum required value
callbackFunctionOnNetworkDown function Function that run on network down
callbackFunctionOnNetworkTest function Function that run after network check
imageUrl string dummy image url
callbackFunctionOnNetworkTest string image size

License

MIT © rajanlagah

Medium post

alert-when-internet-speed-go-below-threshold

Note

Dont forget to give star to this repo on github...

react-internet-meter's People

Contributors

rajanlagah avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.