@justuseit/useonoffline
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

useOnOffLine Hook

Just use it

calls callback on outside Click and esc key

import useOnlOffLine from '@justuseit/useOnlOffLine';

const Component = () => {
  const status = useOnlOffLine();

  return (
    <div>
      <div style={{ color: status ? '#87d068' : '#f50' }}>
        {status ? 'online' : 'offline'}
      </div>
    </div>
  );
};

Readme

Keywords

none

Package Sidebar

Install

npm i @justuseit/useonoffline

Weekly Downloads

0

Version

0.1.1

License

MIT

Unpacked Size

8.33 kB

Total Files

14

Last publish

Collaborators

  • datentyp