1.0.3 • Published 3 years ago

nicecode-utils v1.0.3

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

自定义工具函数库

1.下载安装

npm i nicecode-utils --save

2.API简介

*全局对象: utils

*方法:

(1). debounce(callback, time) 防抖

​ 参数: callback回调函数, time等待时间

(2). throttle(callback, wait) 节流

​ 参数: callback回调函数, wait等待时间

(3). clone(target) 浅拷贝

​ 参数: target目标对象

(4). deepClone(target, map=new Map()) 深拷贝

​ 参数: target目标对象, map:解决对象属性循环引用问题(不需要传此参数)

(5). unique (array) 数组去重

​ 参数: array 目标数组