MCPcopy
hub / github.com/alibaba/hooks / setValue

Function setValue

packages/hooks/src/useCounter/index.ts:41–49  ·  view source on GitHub ↗
(value: ValueParam)

Source from the content-addressed store, hash-verified

39 });
40
41 const setValue = (value: ValueParam) => {
42 setCurrent((c) => {
43 const target = isNumber(value) ? value : value(c);
44 return getTargetValue(target, {
45 max,
46 min,
47 });
48 });
49 };
50
51 const inc = (delta: number = 1) => {
52 setValue((c) => c + delta);

Callers 15

demo1.tsxFile · 0.85
demo3.tsxFile · 0.85
demo2.tsxFile · 0.85
index.spec.tsFile · 0.85
demo1.tsxFile · 0.85
demo1.tsxFile · 0.85
incFunction · 0.85
decFunction · 0.85
setFunction · 0.85
resetFunction · 0.85
demo2.tsxFile · 0.85
demo2.tsxFile · 0.85

Calls 3

isNumberFunction · 0.90
valueFunction · 0.85
getTargetValueFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…