Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Object
*
function
Object
Object
Array
*
*
function
setTimeout的hooks实现
*
*
*
Boolean
Boolean
Object
真假值状态封装
Object
弹出框状态封装
Kind: global constant
Description:: 在hooks中使用事件监听器
Param | Type | Description |
---|---|---|
target | * | dom对象或其ref引用 |
eventName | * | 事件名称 |
listener | * | 事件监听器 |
Object
Kind: global constant
Returns: Object
- {width, height}
Description:: 监听元素大小变化
Param | Description |
---|---|
ref | 元素ref引用 |
*
Kind: global constant
Returns: *
- 鼠标位置信息
Description:: 获取鼠标位置信息
function
Kind: global constant
Returns: function
- 一个获取拖拽属性的函数,入参为拖拽传输的数据
Description:: 获取可以被拖拽的元素属性
Param | Type | Description |
---|---|---|
config | Object | 拖拽开始执行的函数, 拖拽结束执行的函数 |
Object
Kind: global constant
Returns: Object
- 释放元素属性
Description:: 获取接收被拖拽内容的元素的属性
Object
Kind: global constant
Returns: Object
- 包含宽度和拖拽状态的对象
Description:: 拉伸容器
Param | Type | Description |
---|---|---|
options | Object | |
options.defaultWidth | Number | 默认宽度 |
options.minWidth | Number | 最小宽度 |
options.maxWidth | Number | 最大宽度 |
options.target | * | 被拉伸的容器 |
options.siderTarget | * | 用于拉伸的边缘 |
Array
Kind: global constant
Returns: Array
- 异步方法和状态信息
Description:: 异步方法的简单封装,处理请求的loading状态
Param | Type | Description |
---|---|---|
method | function | 异步方法 |
[initialData] | Object | 初始数据 |
Kind: global constant
Description:: 请求方法的简单封装,处理请求的loading状态
Param | Type | Description |
---|---|---|
options | Object | 配置 |
options.method | function | 请求方法 |
[options.defaultParams] | Object | 默认参数 |
[options.necessaryParams] | Object | 必要参数 |
[options.ready] | Boolean | === true时发起请求,默认值为true |
[options.initialData] | * | 初始数据 |
[options.rest] | Array | 请求方法额外参数, onError事件等options可以通过这个参数传递 |
*
Kind: global constant
Returns: *
- pagination
Description:: 处理分页状态的hooks
Param | Type | Description |
---|---|---|
config | Object | |
config.defaultPageSize | * | 默认分页大小 |
config.total | * | 总数据条数 |
Kind: global constant
Description:: 封装方便antd table使用的hooks
Param | Type | Default | Description |
---|---|---|---|
options | Object | 配置信息 | |
options.method | function | 请求方法 | |
[options.defaultPageSize] | Number | 10 | 默认分页大小 |
[options.necessaryParams] | Object | 必要请求参数 | |
[options.rowSelection] | Object | Boolean | 选择功能配置, 传true使用默认 | |
[options.formatter] | function | 请求结果数据转换函数, 返回{total, dataSource} |
*
Kind: global constant
Returns: *
- clearInterval
Description:: setInterval的hooks实现
Param | Type | Description |
---|---|---|
func | function | 要执行的函数 |
interval | Number | 执行间隔 |
deps | Array | 依赖项 |
function
setTimeout的hooks实现
Kind: global constant
Returns: function
- clearTimeout
Param | Type | Description |
---|---|---|
func | function | 要执行的函数 |
timeout | Number | 执行间隔 |
deps | Array | 依赖项 |
*
Kind: global constant
Returns: *
- 放缓变化的值
Description:: 放缓获取value的速率(节流)
Param | Type | Description |
---|---|---|
value | * | 要节流的值 |
wait | Number | 节流时间间隔 |
*
Kind: global constant
Returns: *
- 处理后的值
Description:: 合并一定时间内多次获取value的值(防抖)
Param | Type | Description |
---|---|---|
value | * | 要节流的值 |
wait | Number | 节流时间间隔 |
Kind: global constant
Description:: 自定义useEffect的更新逻辑
Param | Type | Description |
---|---|---|
effect | EffectCallback | 作用 |
deps | Array | 依赖 |
shouldUpdate | function | 是否执行作用,返回true执行effect |
Kind: global constant
Description:: 自定义useEffect的依赖比较逻辑
Param | Type | Description |
---|---|---|
effect | EffectCallback | 作用 |
deps | Array | 依赖 |
compare | function | 自定义比较函数 |
Kind: global constant
Description:: 使用深比较的useEffect
Param | Type | Description |
---|---|---|
effect | EffectCallback | 作用 |
deps | Array | 依赖 |
*
Kind: global constant
Returns: *
- 前一个值
Description:: 获取上一个值
Param | Type | Description |
---|---|---|
state | * | 当前值 |
[compare] | function | 比较函数, 返回true时更新上一个值,默认每次渲染都更新 |
Kind: global constant
Description:: 组件更新时执行的事件
Param | Type | Description |
---|---|---|
fn | function | 要执行的函数 |
deps | Array | 依赖项 |
Kind: global constant
Description:: 组件卸载时执行的操作
Param | Type | Description |
---|---|---|
fn | function | 操作函数 |
Boolean
Kind: global constant
Returns: Boolean
- : 组件是否已卸载
Description:: 获取组件卸载状态
Boolean
Kind: global constant
Returns: Boolean
- : 组件是否已挂载
Description:: 获取组件卸载状态
Kind: global constant
Description:: 值变化时打印
Param | Type | Description |
---|---|---|
args | array | 打印内容 |
Object
真假值状态封装
Kind: global constant
Param | Type | Description |
---|---|---|
initialFlag | * | 初始状态 |
Object
弹出框状态封装
Kind: global constant
Param | Type | Description |
---|---|---|
[initialProps] | Object | modal属性初始值 |
FAQs
Made with create-react-library
The npm package lian-hooks receives a total of 2 weekly downloads. As such, lian-hooks popularity was classified as not popular.
We found that lian-hooks demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.