Scan your whole stack
From OX Research Newsroom
Are you using @wcstack/debounce?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v4.29.0
@wcstack/debounce was last scanned on 24 Nov 2026 at version 4.29.0. Risk score 0 of 100. No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 4.29.0 LATEST | 24 Nov 2026 | No rules fired |
| 4.28.0 | 23 Nov 2026 | No rules fired |
| 4.27.0 | 23 Nov 2026 | No rules fired |
| 4.26.0 | 18 Nov 2026 | Not shown |
| 4.25.0 | 17 Nov 2026 | Not shown |
Findings for v4.29.0. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.
The score describes 4.29.0; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
🤖 AI coding agents: This README is a package-level reference, not the primary entry point for building a wcstack application. If you have not already done so, first read the repository README and AGENTS.md, then use the wcstack-app skill.
@wcstack/debounce is a headless debounce / throttle component for the wcstack ecosystem.
It is not a visual UI widget.
It is an async primitive node that coalesces a noisy stream of signals into a single quiet-period emission — the same way @wcstack/timer turns the passage of time into reactive state.
It ships two custom elements over one engine:
<wcs-debounce> — emit once after the signal has been idle for wait ms.<wcs-throttle> — emit at most once per wait ms (debounce with maxWait === wait, leading on).@wcstack/debounce follows the CSBC (Core / Shell / Binding Contract) architecture:
DebounceCore) ports lodash's debounce algorithm (leading / trailing / maxWait) and publishes results as events.<wcs-debounce> / <wcs-throttle>) connects that engine to DOM attributes, lifecycle, and declarative commands.static wcBindable) declares observable properties, writable inputs, and callable commands.The essence is "debouncing a signal". A signal can carry a value or be a bare pulse with arguments, so there are two surfaces — use one per element.
source → valueWrite to source; after the quiet period the debounced value is published on the value property (event wcs-debounce:settled). Wire it as source: src; value: debounced — value flows back into state.
trigger(...args) → firedCall the trigger command repeatedly; after the quiet period one wcs-debounce:fired event carries the last args. Because state cannot read a transient pulse as a value, the relay uses tokens:
source →(command-token)→ debounce.trigger →[coalesce]→ fired →(event-token)→ state → target.method
State fires the entry with the command-token protocol (command.trigger: $command.X) and receives the single coalesced pulse with the event-token protocol (eventToken.fired: Y), then re-dispatches it to the real method.
A single element instance is meant for one surface. If both
sourceandtriggerare driven on the same element, the last scheduled signal wins (lodash's last-args semantics).
npm install @wcstack/debounce
<script type="module" src="https://esm.run/@wcstack/debounce/auto"></script>
<script type="module" src="https://esm.run/@wcstack/state/auto"></script>
<wcs-state>
<script type="module">
export default {
query: "",
debouncedQuery: null // the element writes null until the first settle
};
</script>
</wcs-state>
<input data-wcs="value: query">
<wcs-debounce wait="300" data-wcs="source: query; value: debouncedQuery"></wcs-debounce>
<p>Searching for: {{ debouncedQuery }}</p>
<wcs-state>
<script type="module">
export default {
$commandTokens: ["search"],
$eventTokens: ["searchSettled"],
results: [],
onSearchInput(e) {
// Emit the query string, not the event: a command emitted from an
// `oninput:` binding receives the Event as its first argument, and
// `<wcs-debounce>` keeps the args verbatim.
this.$command.search.emit(e.target.value);
},
$on: {
searchSettled: (state, event) => {
// fires once, 300ms after the last keystroke
const [q] = event.detail.args;
state.results = doSearch(q);
}
}
};
</script>
</wcs-state>
<input data-wcs="oninput: onSearchInput">
<wcs-debounce
wait="300"
data-wcs="command.trigger: $command.search; eventToken.fired: searchSettled">
</wcs-debounce>
<wcs-throttle wait="100" data-wcs="source: scrollY; value: throttledScrollY"></wcs-throttle>
<wcs-throttle> leads by default (emits immediately, then at most once per wait ms).
| Attribute | Type | Default (<wcs-debounce>) |
Default (<wcs-throttle>) |
Description |
|---|---|---|---|---|
wait |
number | 250 |
250 |
Quiet period in ms. Invalid / negative / non-numeric values fall back to the default. |
leading |
boolean | off | on (no-leading opts out) |
Emit on the first signal of a burst. On <wcs-throttle> the leading property reads and writes no-leading. |
no-trailing |
boolean | off (trailing on) | off (trailing on) | Opt out of the trailing-edge emission. |
max-wait |
number | none | wait |
Force an emission at least every max-wait ms under continuous input. Clamped to >= wait. |
source |
any | — | — | Value-surface input; its debounced echo returns on value. |
null and undefined. The inputs backed by an attribute (wait, leading, trailing, maxWait) take null as "clear": the attribute is removed and the input falls back to its default — for trailing, whose attribute is the inverted no-trailing, and for <wcs-throttle>'s leading, whose attribute is no-leading, that means on again. undefined means "no value supplied": the attribute goes back to what it was before the first write — the value written in the markup, or none. Neither is ever written as the string "null" / "undefined". (@wcstack/state never writes undefined; React 19 does when a prop that had a value is removed, and so can a direct assignment.) source is not backed by an attribute: null and undefined are values like any other, debounced through to value.
| Property | Event | Description |
|---|---|---|
value |
wcs-debounce:settled |
The debounced value of the latest source write; null until the first settle. |
fired |
wcs-debounce:fired |
The coalesced args of the latest trigger() pulse. |
pending |
wcs-debounce:pending-changed |
true while a debounce is in flight. |
<wcs-throttle> publishes the same shape under the wcs-throttle:* namespace.
value starts as null (since 4.26; up to 4.25 it was undefined). value is an output-only member, so an @wcstack/state binding (value: debouncedQuery) reads it from the element when it attaches: the starting value the state declared is replaced by null until the first settle. Declare it null (debouncedQuery: null) and treat null as "nothing settled yet": a state that declares "" sees it become null on load, and a $watch on it runs with that null. Up to 4.25 the seed was undefined, so a $watch ran with undefined even when the state declared null. cancel, flush and a disconnect leave the last settled value as it is. A source of undefined settles as undefined: source carries what it is given.
| Command | Description |
|---|---|
trigger |
Signal-surface entry: coalesce a pulse carrying ...args. |
cancel |
Drop any pending emission without firing (getters keep values). |
flush |
Emit any buffered payload immediately (no-op if nothing pending). |
:state()<wcs-debounce> / <wcs-throttle> reflect one boolean output state onto their
ElementInternals CustomStateSet,
so you can style them directly from CSS with the :state() pseudo-class — no
data-wcs binding or extra class toggling required.
| State | On when |
|---|---|
pending |
wcs-debounce:pending-changed fires with true (cleared on false) |
<wcs-throttle> reflects the same pending state from its own
wcs-throttle:pending-changed event (it shares the Debounce base class, but
the event namespace — and therefore the wiring — tracks its own eventPrefix).
.spinner { display: none; } /* default */
wcs-debounce:state(pending) ~ .spinner { display: block; } /* while debouncing */
wcs-throttle:state(pending) ~ .indicator { opacity: 1; }
Unlike attributes or classes, :state() cannot be written from outside the
element, so there is no risk of confusing this output state with an input.
Browser support (:state(x) syntax): Chrome/Edge 125+, Safari 17.4+,
Firefox 126+. In older browsers the states are simply never set — :state()
selectors never match, but <wcs-debounce> / <wcs-throttle> themselves keep
working normally (graceful degradation, never-throw).
SSR: :state() cannot be serialized into HTML, so server-rendered markup
never carries these states on first paint. If you need to style the
pre-hydration gap, pair your rule with wcs-debounce:not(:defined) instead.
Custom states are invisible in DevTools' Elements panel and attachInternals()
cannot be called twice, so there is no console way to inspect them directly.
Two debug-only aids are provided for that:
el.debugStates — a snapshot array of the currently-on state names
(e.g. ["pending"]). It is not part of wc-bindable (not a bind target)
and its shape is not a guaranteed contract — use it for debugging only.
The debug-states attribute (opt-in, default off) mirrors state changes
onto a data-wcs-state-pending attribute on the element, so the Elements
panel highlights it as it toggles:
<wcs-debounce wait="300" debug-states></wcs-debounce>
*Write your CSS against :state(), not `data-wcs-state-`.** The mirrored
attribute exists purely to make state changes visible while debugging with
DevTools open; it is not a supported styling hook.
When config.autoTrigger is on (default), a click on an element carrying data-debouncetarget="<id>" fires a single coalesced trigger() pulse on the referenced <wcs-debounce> / <wcs-throttle> (the click's default action is suppressed).
DebounceCore)The Core has no DOM dependency and can be used directly with bind() from @wc-bindable/core:
import { DebounceCore } from "@wcstack/debounce";
const core = new DebounceCore("wcs-debounce", undefined, { wait: 300 });
core.addEventListener("wcs-debounce:settled", (e) => {
console.log((e as CustomEvent).detail.value);
});
core.setSource("a");
core.setSource("b"); // only "b" settles, 300ms later
Throttle is the same engine with a different prefix and maxWait === wait:
const throttle = new DebounceCore("wcs-throttle", undefined, { wait: 100, leading: true, maxWait: 100 });
The structural Core surface is normative across wcstack IO nodes (async-io-node-guidelines §3.9); to bind it into signals with no element at all, see @wcstack/signals — Binding a Core directly.
MIT
Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.
The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.