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

Function getSprings

packages/core/src/Controller.ts:512–533  ·  view source on GitHub ↗
(
  ctrl: Controller<Lookup<any>>,
  props?: OneOrMore<ControllerUpdate<State>>
)

Source from the content-addressed store, hash-verified

510 * until they're given to `setSprings`.
511 */
512export function getSprings<State extends Lookup>(
513 ctrl: Controller<Lookup<any>>,
514 props?: OneOrMore<ControllerUpdate<State>>
515) {
516 const springs = { ...ctrl.springs }
517 if (props) {
518 each(toArray(props), (props: any) => {
519 if (is.und(props.keys)) {
520 props = createUpdate(props)
521 }
522 if (!is.obj(props.to)) {
523 // Avoid passing array/function to each spring.
524 props = { ...props, to: undefined }
525 }
526 prepareSprings(springs as any, props, key => {
527 return createSpring(key)
528 })
529 })
530 }
531 setSprings(ctrl, springs)
532 return springs
533}
534
535/**
536 * Tell a controller to manage the given `SpringValue` objects

Callers 3

flushFunction · 0.90
useSpringsFunction · 0.90
useTransitionFunction · 0.90

Calls 6

eachFunction · 0.90
toArrayFunction · 0.90
createUpdateFunction · 0.90
prepareSpringsFunction · 0.85
createSpringFunction · 0.85
setSpringsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…