How to use no-internet - 1 common examples

To help you get started, we’ve selected a few no-internet examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github shystruk / create-react-redux-app-structure / app / pages / App.jsx View on Github external
componentDidMount() {
        noInternet({callback: (offline) => {
            if (offline && isEmpty(this.props.notification.message)) {
                store.dispatch(pushNotification('You are offline 😎'));
            } else if (!offline && !isEmpty(this.props.notification.message)) {
                store.dispatch(removeNotification());
            }
        }});

        CustomEvent.DISPATCH('WEB_COMP_SHOW_NOTIFICATION', {
            type: 'success',
            message: 'Welcome! I\'m notification-service based on Custom Element'
        });
    }

no-internet

Checking if the internet is accessible (not local connection only)

MIT
Latest version published 3 years ago

Package Health Score

45 / 100
Full package analysis

Popular no-internet functions