New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

react-use-ez

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-use-ez

## publish (owner only)

latest
npmnpm
Version
1.0.9
Version published
Maintainers
1
Created
Source

react-use-ez

publish (owner only)

npm publish

API

useTheme

Demo
import { useTheme, Theme } from "react-use-ez";

const [theme, changeTheme] = useTheme()

<button onClick={() => changeTheme()}>change theme</button>

useBattery

Demo
import { useBattery } from 'react-use-ez'

const battery = useBattery()

useHover

Demo
import { useHover } from 'react-use-ez'

const [hoverRef, isHovering] = useHover()

<div ref={hoverRef}>{isHovering ? "Hovering" : "Not Hovering"}</div>

useCookie

Demo
import { useCookie } from 'react-use-ez'

const [getCookie, setCookie] = useCookie()

console.log(getCookie("cookie-name"))

<button
    onClick={() => {
      setCookie("cookie-name", "cookie-value");
    }}
  >
    點擊
</button>

setCookie config

  • name
  • value
  • exdays
  • domainName

useRequest

Demo
import { useRequest } from 'react-use-ez'

const getUser = (): Promise<any> => {...}

const { loading, data: users, error } = useRequest(getUsers);

useFactorial

Demo
import { useFactorial } from 'react-use-ez'

const { result } = useFactorial(3) // 6

useMediaQuery

Demo
import { useMediaQuery } from 'react-use-ez'

const isLargeScreen = useMediaQuery('(min-width: 1024px)')

useEyeDropper

Demo
import { useEyeDropper } from 'react-use-ez'

const { isSupported, sRGBHex, open } = useEyeDropper()

useUserInfo

Demo
import { useUserInfo } from 'react-use-ez'

const userInfo = useUserInfo()

Type Declarations

/**
 * ip 位置
 *
 * city 所在城市
 *
 * region 所在地區
 *
 * country 所在國家
 *
 * loc 經緯度
 *
 * org 電信公司
 *
 * timezone 時區
 *
 * readme 說明
 */

useDevice (Inaccurate)

Demo
import { useDevice } from 'react-use-ez'

const { isPhone, isAndroid, isMobile, isMac } = useDevice()

useBoolean

Demo
import { useBoolean } from 'react-use-ez'

const { value, setTrue, setFalse, toggle } = useBoolean(false)

useRemoteConfig (firebase)

Demo
import { useRemoteConfig } from 'react-use-ez'

const firebaseConfig = {
  apiKey: ''
  authDomain: ''
  projectId: ''
  storageBucket: ''
  messagingSenderId: ''
  appId: ''
}

const message = useRemoteConfig(firebaseConfig, 'config-name')

Keywords

react-use-ez

FAQs

Package last updated on 23 Apr 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts