Chain
Chain a sequence of actions, move to the next when the current one completes.
Import
import { chain } from 'popmotion';Usage
chain(
tween({ to: 300 }),
spring({ from: 300, to: 0 })
).start({
update: (v) => console.log(v),
complete: () => console.log('All actions complete')
})Methods
Action methods
chain() returns:
filter((v: any) => boolean): Returns a new action that filters out values when the provided function returnsfalse.pipe(...funcs: Array<(v) => v): Returns a new action that will runupdatevalues through this sequence of functions.start(update | { update, complete }): Starts the action and returns a subscription.while((v: any) => boolean): Returns a new action that willcompletewhen the provided function returnsfalse.
Subscription methods
chain().start() returns:
stop(): void