MCPcopy
hub / github.com/pmndrs/react-spring / setValue

Method setValue

packages/animated/src/AnimatedArray.ts:27–36  ·  view source on GitHub ↗
(source: T)

Source from the content-addressed store, hash-verified

25 }
26
27 setValue(source: T) {
28 const payload = this.getPayload()
29 // Reuse the payload when lengths are equal.
30 if (source.length == payload.length) {
31 return payload.map((node, i) => node.setValue(source[i])).some(Boolean)
32 }
33 // Remake the payload when length changes.
34 super.setValue(source.map(makeAnimated))
35 return true
36 }
37}
38
39function makeAnimated(value: any) {

Callers 3

advanceMethod · 0.45
advanceMethod · 0.45
_setMethod · 0.45

Calls 1

getPayloadMethod · 0.80

Tested by

no test coverage detected