A tiny tool kit library. [keep adding]
npm install petit-kit -S
# or with yarn
yarn add petit-kit
Just import what you need and use it.
import { debounce } from 'petit-kit'
window.addEventListener(
'resize',
debounce(() => {
console.log(window.innerWidth)
console.log(window.innerHeight)
}, 500)
)
import { pick } from 'petit-kit'
pick({ a: 1, b: '2', c: 3 }, ['a', 'c'])
// { 'a': 1, 'c': 3 }
import { throttle } from 'petit-kit'
setInterval(
throttle(() => {
console.log(Date.now())
}, 1000),
1
)