@syyu/util
TypeScript icon, indicating that this package has built-in type declarations

1.3.0 • Public • Published

@syyu/util

Javascript/Typescript Utility Package for Practice

REACT

import {...} from '@syyu/util/react'

useModal

  • A React hook for using Modal easily
  • DOCS

useForm (beta)

  • A React hook for using form easily
  • During the beta period, the API may unexpectedly change or new features may be added
  • supports textarea and inputs (text, number, checkbox)
  • provides APIs, createUseFormContext and useFormContext for integrating with Context API
  • DOCS

useBooleanState

  • A useState hook for using boolean state conveniently
  • example const [display, show, hide, toggle] = useBooleanState(initialState)
  • If initialState is not provided as an argument, the default state value is set to false.
  • DOCS

useClipboard

  • A React hook for copying something (now only providing plain text) to clipboard
  • other types will be provided later
  • example: const { copy, isCopied, restoreState } = useClipboard(type, duration, onError)
  • works only in localhost or https
  • DOCS

useDebouncedEffect/useDebouncedState

  • A React hook for debounced effect/state
  • DOCS

useConditionalRender

  • A React hook for using conditional render easily
  • useful in triggering animation with (un)mounting component
  • DOCS

JS/TS

import {...} from '@syyu/util'

objectKeys

alternative of Object.keys() with type assertion

objectEntries

alternative of Object.Entries() with type assertion

Package Sidebar

Install

npm i @syyu/util

Weekly Downloads

51

Version

1.3.0

License

MIT

Unpacked Size

39 kB

Total Files

12

Last publish

Collaborators

  • yoonyu