petit-kit
    TypeScript icon, indicating that this package has built-in type declarations

    1.0.6 • Public • Published

    petit-kit

    A tiny tool kit library. [keep adding]

    Installation

    npm install petit-kit -S
    # or with yarn 
    yarn add petit-kit

    Usage

    Just import what you need and use it.

    debounce

    import { debounce } from 'petit-kit'
     
    window.addEventListener(
      'resize',
      debounce(() => {
        console.log(window.innerWidth)
        console.log(window.innerHeight)
      }, 500)
    )

    pick

    import { pick } from 'petit-kit'
     
    pick({ a: 1, b: '2', c: 3 }, ['a', 'c'])
    // { 'a': 1, 'c': 3 }

    throttle

    import { throttle } from 'petit-kit'
     
    setInterval(
      throttle(() => {
        console.log(Date.now())
      }, 1000),
      1
    )

    Keywords

    Install

    npm i petit-kit

    DownloadsWeekly Downloads

    16

    Version

    1.0.6

    License

    MIT

    Unpacked Size

    5.23 kB

    Total Files

    5

    Last publish

    Collaborators

    • kingzez