React-Beautiful react hooks 1.0.0: A collection of beautiful and (hopefully) useful React hooks to speed-up your components and hooks development

icon
Latest Release: 1.0.0

Build Status License: MIT npm GitHub stars

Beautiful React Hooks

A collection of beautiful (and hopefully useful) React hooks to speed-up your components and hooks development

Usage example

? Why?

React custom hooks allow to abstract components' business logic into single reusable functions.
So far, I've found that most of the hooks I've created and therefore shared between my projects have quite often a similar gist that involves callback references, events and components' lifecycle.
For this reason I've tried to sum up that gist into beautiful-react-hooks: a collection of (hopefully) useful React hooks to possibly help other developers to speed up their development process.

Furthermore, I've tried to create a concise yet concrete API having in mind the code readability, focusing to keep the learning curve as lower as possible so that the it can be used and shared in bigger teams.

-- Please before using any hook, read its documentation! --

☕️ Features

  • Concise API
  • Small and lightweight
  • Easy to learn
  • Functional approach
  • Fully written in JS (although TS types are supported)

? Install

by using npm:

$ npm install beautiful-react-hooks

by using yarn:

$ yarn add beautiful-react-hooks

? Hooks

Contributing

Contributions are very welcome and wanted.

To submit your custom hook, please make sure your read our CONTRIBUTING guidelines.

Before submitting a new merge request, please make sure:

  1. You have updated the package.json version and reported your changed into the CHANGELOG file
  2. make sure you run npm test and npm build before submitting your merge request.
  3. make sure you've added the documentation of your custom hook (you can possibly use the HOOK_DOCUMENTATION_TEMPLATE to document your custom hook).
  4. make sure you've updated the index.d.ts file with your hook types.

Made with

Credits

This library is provided and sponsored by:

As part of our commitment to support and provide the open source community.


Comments

  • [skip ci] Bump @typescript-eslint/parser from 4.31.1 to 4.33.0
    [skip ci] Bump @typescript-eslint/parser from 4.31.1 to 4.33.0

    Oct 6, 2021

    Bumps @typescript-eslint/parser from 4.31.1 to 4.33.0.

    Release notes

    Sourced from @​typescript-eslint/parser's releases.

    v4.33.0

    4.33.0 (2021-10-04)

    Bug Fixes

    • eslint-plugin: [lines-between-class-members] fix exceptAfterOverload for abstract methods (#3943) (240fc65)
    • eslint-plugin: [no-confusing-void-expression] support optional chaining (#3937) (c40dd13)
    • eslint-plugin: [no-restricted-imports] fix crash when no options given (#3947) (edaa3c1)
    • eslint-plugin: [non-nullable-type-assertion-style] false-positive with non-nullish as assertions and types (#3940) (40760f9)
    • eslint-plugin: [padding-line-between-statements] TSModuleBlock should change scope (#3944) (f8f534e)
    • eslint-plugin: [prefer-regexp-exec] check RegExp without flags (#3946) (0868725)
    • experimental-utils: add getPhysicalFilename() to RuleContext (#3934) (ee5dfd4)
    • experimental-utils: require fix in suggestions (#3949) (f022fb1)

    Features

    • experimental-utils: extract isNodeOfTypeWithConditions out of ast-utils' predicates (#3837) (214f898)

    v4.32.0

    4.32.0 (2021-09-27)

    Bug Fixes

    • eslint-plugin: [consistent-type-definitions] correct fix for export default (#3899) (ebb33ed)
    • eslint-plugin: [no-require-imports] report only global require (#3871) (8aa87a1)
    • eslint-plugin: [no-shadow] ignore type-only imports properly (#3868) (dda9cee)
    • eslint-plugin: [no-var-requires] report problems within NewExpression (#3884) (ed5e459)
    • eslint-plugin: [padding-line-between-statements] problems within namespaces not being reported (#3869) (1861356)
    • eslint-plugin: [prefer-regexp-exec] respect flags when using RegExp (#3855) (ffdb5ff)
    • eslint-plugin: [prefer-return-this-type] handle generics properly in fixer (#3852) (9e98b8f)
    • eslint-plugin: false-positive/negative with array index in no-unnecessary-condition (#3805) (bdb8f0b)
    • experimental-utils: add missing signature for isParenthesized (#3887) (806eaac)

    Features

    • eslint-plugin: [no-type-alias]: add allowGenerics option (#3865) (4195919)
    • eslint-plugin: add no-non-null-asserted-nullish-coalescing rule (#3349) (4e99961)
    • eslint-plugin: add new extended rule no-restricted-imports (#3775) (ec5d506)
    • eslint-plugin-internal: [prefer-ast-types-enum] add DefinitionType enum (#3916) (13b7de5)
    • Support 'latest' as ecmaVersion (#3873) (25a42c0)

    v4.31.2

    4.31.2 (2021-09-20)

    Note: Version bump only for package @​typescript-eslint/typescript-eslint

    Changelog

    Sourced from @​typescript-eslint/parser's changelog.

    4.33.0 (2021-10-04)

    Note: Version bump only for package @​typescript-eslint/parser

    4.32.0 (2021-09-27)

    Features

    4.31.2 (2021-09-20)

    Note: Version bump only for package @​typescript-eslint/parser

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    Reply
  • [skip ci] Bump @typescript-eslint/eslint-plugin from 4.31.1 to 4.33.0
    [skip ci] Bump @typescript-eslint/eslint-plugin from 4.31.1 to 4.33.0

    Oct 6, 2021

    Bumps @typescript-eslint/eslint-plugin from 4.31.1 to 4.33.0.

    Release notes

    Sourced from @​typescript-eslint/eslint-plugin's releases.

    v4.33.0

    4.33.0 (2021-10-04)

    Bug Fixes

    • eslint-plugin: [lines-between-class-members] fix exceptAfterOverload for abstract methods (#3943) (240fc65)
    • eslint-plugin: [no-confusing-void-expression] support optional chaining (#3937) (c40dd13)
    • eslint-plugin: [no-restricted-imports] fix crash when no options given (#3947) (edaa3c1)
    • eslint-plugin: [non-nullable-type-assertion-style] false-positive with non-nullish as assertions and types (#3940) (40760f9)
    • eslint-plugin: [padding-line-between-statements] TSModuleBlock should change scope (#3944) (f8f534e)
    • eslint-plugin: [prefer-regexp-exec] check RegExp without flags (#3946) (0868725)
    • experimental-utils: add getPhysicalFilename() to RuleContext (#3934) (ee5dfd4)
    • experimental-utils: require fix in suggestions (#3949) (f022fb1)

    Features

    • experimental-utils: extract isNodeOfTypeWithConditions out of ast-utils' predicates (#3837) (214f898)

    v4.32.0

    4.32.0 (2021-09-27)

    Bug Fixes

    • eslint-plugin: [consistent-type-definitions] correct fix for export default (#3899) (ebb33ed)
    • eslint-plugin: [no-require-imports] report only global require (#3871) (8aa87a1)
    • eslint-plugin: [no-shadow] ignore type-only imports properly (#3868) (dda9cee)
    • eslint-plugin: [no-var-requires] report problems within NewExpression (#3884) (ed5e459)
    • eslint-plugin: [padding-line-between-statements] problems within namespaces not being reported (#3869) (1861356)
    • eslint-plugin: [prefer-regexp-exec] respect flags when using RegExp (#3855) (ffdb5ff)
    • eslint-plugin: [prefer-return-this-type] handle generics properly in fixer (#3852) (9e98b8f)
    • eslint-plugin: false-positive/negative with array index in no-unnecessary-condition (#3805) (bdb8f0b)
    • experimental-utils: add missing signature for isParenthesized (#3887) (806eaac)

    Features

    • eslint-plugin: [no-type-alias]: add allowGenerics option (#3865) (4195919)
    • eslint-plugin: add no-non-null-asserted-nullish-coalescing rule (#3349) (4e99961)
    • eslint-plugin: add new extended rule no-restricted-imports (#3775) (ec5d506)
    • eslint-plugin-internal: [prefer-ast-types-enum] add DefinitionType enum (#3916) (13b7de5)
    • Support 'latest' as ecmaVersion (#3873) (25a42c0)

    v4.31.2

    4.31.2 (2021-09-20)

    Note: Version bump only for package @​typescript-eslint/typescript-eslint

    Changelog

    Sourced from @​typescript-eslint/eslint-plugin's changelog.

    4.33.0 (2021-10-04)

    Bug Fixes

    • eslint-plugin: [lines-between-class-members] fix exceptAfterOverload for abstract methods (#3943) (240fc65)
    • eslint-plugin: [no-confusing-void-expression] support optional chaining (#3937) (c40dd13)
    • eslint-plugin: [no-restricted-imports] fix crash when no options given (#3947) (edaa3c1)
    • eslint-plugin: [non-nullable-type-assertion-style] false-positive with non-nullish as assertions and types (#3940) (40760f9)
    • eslint-plugin: [padding-line-between-statements] TSModuleBlock should change scope (#3944) (f8f534e)
    • eslint-plugin: [prefer-regexp-exec] check RegExp without flags (#3946) (0868725)

    4.32.0 (2021-09-27)

    Bug Fixes

    • eslint-plugin: [consistent-type-definitions] correct fix for export default (#3899) (ebb33ed)
    • eslint-plugin: [no-require-imports] report only global require (#3871) (8aa87a1)
    • eslint-plugin: [no-shadow] ignore type-only imports properly (#3868) (dda9cee)
    • eslint-plugin: [no-var-requires] report problems within NewExpression (#3884) (ed5e459)
    • eslint-plugin: [padding-line-between-statements] problems within namespaces not being reported (#3869) (1861356)
    • eslint-plugin: [prefer-regexp-exec] respect flags when using RegExp (#3855) (ffdb5ff)
    • eslint-plugin: [prefer-return-this-type] handle generics properly in fixer (#3852) (9e98b8f)
    • eslint-plugin: false-positive/negative with array index in no-unnecessary-condition (#3805) (bdb8f0b)

    Features

    • eslint-plugin: [no-type-alias]: add allowGenerics option (#3865) (4195919)
    • eslint-plugin: add no-non-null-asserted-nullish-coalescing rule (#3349) (4e99961)
    • eslint-plugin: add new extended rule no-restricted-imports (#3775) (ec5d506)
    • eslint-plugin-internal: [prefer-ast-types-enum] add DefinitionType enum (#3916) (13b7de5)

    4.31.2 (2021-09-20)

    Note: Version bump only for package @​typescript-eslint/eslint-plugin

    Commits
    • 7bf8c9c chore: publish v4.33.0
    • edaa3c1 fix(eslint-plugin): [no-restricted-imports] fix crash when no options given (...
    • 0868725 fix(eslint-plugin): [prefer-regexp-exec] check RegExp without flags (#3946)
    • f8f534e fix(eslint-plugin): [padding-line-between-statements] TSModuleBlock should ch...
    • 240fc65 fix(eslint-plugin): [lines-between-class-members] fix exceptAfterOverload f...
    • 40760f9 fix(eslint-plugin): [non-nullable-type-assertion-style] false-positive with n...
    • c40dd13 fix(eslint-plugin): [no-confusing-void-expression] support optional chaining ...
    • 35a8acf refactor(eslint-plugin): [no-shadow] use findVariable from utils (#3921)
    • 3c773e4 docs(eslint-plugin): [no-unsafe-argument] fix grammar (#3889)
    • 02c6ff3 chore: publish v4.32.0
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    Reply
  • useMediaQuery in Next.js produces in
    ."" class="image-fit lazy">
    useMediaQuery in Next.js produces "Warning: Expected server HTML to contain a matching
    in
    ."

    Oct 23, 2021

    Describe the bug If you use in a Next.js Application useMedaQuery it results in the same issue described here: https://github.com/vercel/next.js/discussions/17443

    To Reproduce Steps to reproduce the behavior:

    1. Use Next.js Application and implement useMedaQuery in one Component
    2. Load the dev environment of that Application
    3. Open Browser Console ( any current Firefox or CHrome will do)
    4. Press F5 in Browser to reload
    5. See error in console

    Expected behavior No error is thrown, as it further breaks reloading CSS in Next.js Dev Application and probably more.

    Additional context Following this amazing description: https://dev.to/adrien/creating-a-custom-react-hook-to-get-the-window-s-dimensions-in-next-js-135k it works for me like this right now:

    import { useEffect, useState } from 'react';
    
    const useMediaQuery = (mediaQuery: string): boolean => {
      const [isVerified, setIsVerified] = useState(false);
    
      useEffect(() => {
        const mediaQueryList = window.matchMedia(mediaQuery);
        const documentChangeHandler = (): void => setIsVerified(!!mediaQueryList.matches);
    
        try {
          mediaQueryList.addEventListener('change', documentChangeHandler);
        } catch (e) {
          // Safari isn't supporting mediaQueryList.addEventListener
          mediaQueryList.addListener(documentChangeHandler);
        }
    
        documentChangeHandler();
    
        return (): void => {
          try {
            mediaQueryList.removeEventListener('change', documentChangeHandler);
          } catch (e) {
            // Safari isn't supporting mediaQueryList.removeEventListener
            mediaQueryList.removeListener(documentChangeHandler);
          }
        };
        // eslint-disable-next-line react-hooks/exhaustive-deps
      }, []); // Empty array ensures that effect is only run on mount
    
      return isVerified;
    };
    
    export { useMediaQuery };
    
    Reply
  • Use dark mode
    Use dark mode

    Nov 1, 2021

    Is your feature request related to a problem? Please describe. Missing a hook that allows easy dark mode usage.

    I have been using https://github.com/donavon/use-dark-mode but it seems to me unsupported. It would be great if you could add a hook here.

    Describe the solution you'd like It should allow to toggle darkmode. It should also allow to enable a feature that automatically reads out the prefer-color-scheme media query.

    enhancement feature request 
    Reply
  • [skip ci] Bump rxjs from 7.3.0 to 7.5.2
    [skip ci] Bump rxjs from 7.3.0 to 7.5.2

    Jan 17, 2022

    Bumps rxjs from 7.3.0 to 7.5.2.

    Changelog

    Sourced from rxjs's changelog.

    7.5.2 (2022-01-11)

    Bug Fixes

    • operators that ignore input values now use unknown rather than any, which should resolve issues with eslint no-unsafe-argument (#6738) (67cb317), closes #6536
    • ajax: crossDomain flag deprecated and properly reported to consumers (#6710) (7fd0575), closes #6663

    7.5.1 (2021-12-28)

    Bug Fixes

    • export supporting interfaces from top-level rxjs site. (#6733) (299a1e1)

    7.5.0 (2021-12-27)

    Bug Fixes

    • takeWhile: Now returns proper types when passed a Boolean constructor. (#6633) (081ca2b)
    • forEach: properly unsubs after error in next handler (#6677) (b9ab67d), closes #6676
    • WebSocketSubject: handle slow WebSocket close (#6708) (8cb201c), closes #4650 #3935
    • RxJS now supports tslib 2.x, rather than just 2.1.x (#6692) (0b2495f), closes #6689
    • schedulers will no longer error while rescheduling and unsubscribing during flushes (e35f589), closes #6672

    Features

    7.4.0 (2021-10-06)

    Features

    7.3.1 (2021-10-01)

    Bug Fixes

    • Schedulers: Throwing a falsy error in a scheduled function no longer results in strange error objects. (#6594) (c70fcc0)
    • scheduling with Rx-provided schedulers will no longer leak action references (#6562) (ff5a748), closes #6561
    • forkJoin: now finalizes sources before emitting (#6546) (c52ff2e), closes #4914
    • observeOn: release action references on teardown (321d205)
    • types: update schedule signature overload (c61e57c)
    Commits
    • fdfc8ac chore(publish): 7.5.2
    • 67cb317 fix: operators that ignore input values now use unknown rather than any, ...
    • 45abd01 docs: update operator imports in content examples (#6739)
    • c0ed6c5 chore: fixing deprecated subscribe and tap calls (#6740)
    • 7fd0575 fix(ajax): crossDomain flag deprecated and properly reported to consumers (#6...
    • 5e8ab00 docs(dematerialize.ts): move away from bracket casts (#6737)
    • 7268bd3 docs: fix links in code snippets (#6734)
    • 888c753 docs: update operator imports in examples (#6678)
    • bca49bd chore(publish): 7.5.1
    • 033bfca chore: Ensure we are using TS 4.2 for rxjs development
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    Reply
  • [skip ci] Bump mocha from 9.1.1 to 9.1.4
    [skip ci] Bump mocha from 9.1.1 to 9.1.4

    Jan 17, 2022

    Bumps mocha from 9.1.1 to 9.1.4.

    Release notes

    Sourced from mocha's releases.

    v9.1.4

    9.1.4 / 2022-01-14

    Please also note our announcements.

    :bug: Fixes

    :nut_and_bolt: Other

    v9.1.3

    9.1.3 / 2021-10-15

    Please also note our announcements.

    :bug: Fixes

    :nut_and_bolt: Other

    v9.1.2

    9.1.2 / 2021-09-25

    Please also note our announcements.

    :bug: Fixes

    :nut_and_bolt: Other

    Changelog

    Sourced from mocha's changelog.

    9.1.4 / 2022-01-14

    :bug: Fixes

    :nut_and_bolt: Other

    9.1.3 / 2021-10-15

    :bug: Fixes

    :nut_and_bolt: Other

    9.1.2 / 2021-09-25

    :bug: Fixes

    :nut_and_bolt: Other

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    Reply
  • useDebouncedFn clearing timeouts
    useDebouncedFn clearing timeouts

    Jan 22, 2020

    Hey,

    As I can see you don't use debounced.cancel() here for clearing timeout. Am I right or I missed something? :)

    Reply
  • useRequestAnimationFrame hook gives
    useRequestAnimationFrame hook gives "Object(...) is not a function error" on SSR

    Feb 21, 2020

    Tried to use useRequestAnimationFrame on a project and when trying to use it, I end up with Object(...) is not a function error

    To Reproduce Steps to reproduce the behavior:

    1. Import import { useRequestAnimationFrame } from 'beautiful-react-hooks';
    2. Add the hook in the component
    import { useRequestAnimationFrame } from 'beautiful-react-hooks';
    
    const MyComponent = ({ someProp, ...props }) => {
        const options = { finishAt: -1 };
    
        useRequestAnimationFrame((progress, next) => {
           console.log('test');
        }, options);
    
        return (
            <div />
        );
    };
    
    1. Go to webpage
    2. See error

    Expected behavior Obviously, have an RAF loop

    Desktop (please complete the following information):

    • OS: High sierra 10.13.6
    • Browser: Chrome 79.0.3945.130

    Additional context Project is using Next.js

    bug 
    Reply
  • Using addEventListener instead of addListener that is deprecated
    Using addEventListener instead of addListener that is deprecated

    Apr 22, 2021

    MediaQueryList.addListener() is no longer recommended. See https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryList/addListener

    Reply
  • Support ES Modules
    Support ES Modules

    May 28, 2020

    Is your feature request related to a problem? Please describe. I'm trying to export my React app as a component and I'm using beautiful-react-hooks. Currently this library is only exported as CommonJS module, so it is not tree-shakable.

    Describe the solution you'd like Add a ESModule file in rollup.config.js. It is format: es in output.

    enhancement 
    Reply
  • useDebouncedFn seems not debounce
    useDebouncedFn seems not debounce

    Feb 20, 2020

    Describe the bug

    I'm calling useDebouncedFn in onChange

      const setOutsideValue = useDebouncedFn(() => {
        console.log('called');
        
      }, 500)
    
    
      return (
        <Slate editor={editor} value={value} onChange={nextValue => {setValue(nextValue);setOutsideValue()}}>
    

    And it is called as much as I type, after 500ms.

    Screen Shot 2020-02-20 at 8 25 20 PM

    To Reproduce Add later...

    (Update: https://stackblitz.com/edit/react-ombwbo)

    Expected behavior Only called 500ms a time.

    Desktop (please complete the following information):

    • Electron 8.0.1
    Reply
  • Always be online if the browser does not support online/offline status
    Always be online if the browser does not support online/offline status

    Jan 17, 2020

    Description

    In general cases, someone who going to use an online hook, is more likely wanna know when does his user's network status be switched to offline, so he can deliver a notice or different content to his users. So it is default to be online.

    Reply