# 工具函数模块
工具函数模块提供防抖、节流、延迟执行等通用工具函数。
## API 列表
### debounce(func, delay) - 防抖函数
```javascript
const debouncedSearch = sinma.debounce((keyword) => {
console.log('搜索:', keyword);
}, 300);
// 300ms内多次调用只会执行最后一次
debouncedSearch('hello');
debouncedSearch('world'); // 只有这次会执行
```
### throttle(func, delay) - 节流函数
```javascript
const throttledScroll = sinma.throttle(() => {
console.log('滚动处理');
}, 100);
window.addEventListener('scroll', throttledScroll);
```
### sleep(ms) - 延迟执行
```javascript
async function example() {
console.log('开始');
await sinma.sleep(1000); // 等待1秒
console.log('结束');
}
```
### getType(value) - 获取数据类型
```javascript
sinma.getType([]); // 'array'
sinma.getType({}); // 'object'
sinma.getType('hello'); // 'string'
sinma.getType(null); // 'null'
```
