
Security News
AGENTS.md Gains Traction as an Open Format for AI Coding Agents
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
debounce-throttle
Advanced tools
lodash debounce and throttle function built by lodash-cli to support UMD
lodash debounce and throttle function built by lodash-cli to support UMD and gain size benefit.
在使用 lodash 库的节流函数时,感觉有 2 个问题不太友好,所以定制了只包含 debounce 和 throttle 函数的库,方便自己使用。
模块化问题:lodash.debounce 和 lodash.throttle 只支持CMD。
文件大小问题:无论是下载 lodash 还是分别下载 lodash.debounce, lodash.throttle 都有代码冗余。因为 lodash.throttle 是用 lodash.debounce 实现的,分别下载 lodash.debounce, lodash.throttle 相当于下载了 2 份代码!
该定制为 UMD 的,所以支持多种引用方式
import 引入
import {debounce, throttle} from 'debounce-throttle'
require 引入
const {debounce, throttle} = require 'debounce-throttle'
定义在全局对象上
const {debounce, throttle} = window._
具体使用见lodash文档
FAQs
lodash debounce and throttle function built by lodash-cli to support UMD
The npm package debounce-throttle receives a total of 318 weekly downloads. As such, debounce-throttle popularity was classified as not popular.
We found that debounce-throttle 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.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.