nicecode-utils

1.0.3 • Public • Published

自定义工具函数库

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 目标数组

Package Sidebar

Install

npm i nicecode-utils

Weekly Downloads

0

Version

1.0.3

License

ISC

Unpacked Size

14.2 kB

Total Files

9

Last publish

Collaborators

  • nicecode0