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

Function getPausedLoop

packages/core/src/Controller.test.ts:535–556  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

533
534 describe('when "finish" is called while paused', () => {
535 async function getPausedLoop() {
536 const ctrl = new Controller<{ t: number }>({
537 from: { t: 0 }, // FIXME: replace this line with `t: 0,` for a stack overflow
538 loop: {
539 async to(start) {
540 await start({
541 t: 1,
542 reset: true,
543 })
544 },
545 },
546 })
547
548 // Ensure `loop.to` has been called.
549 await flushMicroTasks()
550
551 // Apply the first frame.
552 global.mockRaf.step()
553
554 ctrl.pause()
555 return ctrl
556 }
557
558 it('finishes immediately', async () => {
559 const ctrl = await getPausedLoop()

Callers 1

Controller.test.tsFile · 0.85

Calls 2

pauseMethod · 0.95
stepMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…