( ctrl: Controller<Lookup<any>>, props?: OneOrMore<ControllerUpdate<State>> )
| 510 | * until they're given to `setSprings`. |
| 511 | */ |
| 512 | export 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 |
no test coverage detected
searching dependent graphs…