@react-spring/core
Advanced tools
Comparing version 9.4.0-beta.3 to 9.4.0-beta.4
@@ -19,2 +19,3 @@ import { Timeout } from '@react-spring/shared'; | ||
timeouts: Set<Timeout>; | ||
delayed?: boolean; | ||
asyncId?: number; | ||
@@ -21,0 +22,0 @@ asyncTo?: AsyncTo<InferState<T>>; |
@@ -51,2 +51,7 @@ import { FluidValue } from '@react-spring/shared'; | ||
get isPaused(): boolean; | ||
/** | ||
* | ||
* | ||
*/ | ||
get isDelayed(): boolean | undefined; | ||
/** Advance the current animation by a number of milliseconds */ | ||
@@ -53,0 +58,0 @@ advance(dt: number): void; |
@@ -412,2 +412,3 @@ import { eachProp, is, toArray, isAnimatedString, Globals, getFluidValue, useLayoutEffect, each, raf, flush, FluidValue, deprecateInterpolate, callFluidObservers, frameLoop, hasFluidValue, flushCalls, isEqual, getFluidObservers, addFluidObserver, removeFluidObserver, noop, useMemoOne, deprecateDirectCall, useForceUpdate, usePrev, useOnce, createInterpolator, createStringInterpolator } from '@react-spring/shared'; | ||
if (delay > 0) { | ||
state.delayed = true; | ||
timeout = raf.setTimeout(onStart, delay); | ||
@@ -422,2 +423,6 @@ state.pauseQueue.add(onPause); | ||
function onStart() { | ||
if (state.delayed) { | ||
state.delayed = false; | ||
} | ||
state.pauseQueue.delete(onPause); | ||
@@ -690,2 +695,3 @@ state.timeouts.delete(timeout); | ||
paused: false, | ||
delayed: false, | ||
pauseQueue: new Set(), | ||
@@ -738,2 +744,6 @@ resumeQueue: new Set(), | ||
get isDelayed() { | ||
return this._state.delayed; | ||
} | ||
advance(dt) { | ||
@@ -942,3 +952,7 @@ let idle = true; | ||
return Promise.all(queue.map(props => this._update(props))).then(results => getCombinedResult(this, results)); | ||
return Promise.all(queue.map(props => { | ||
const up = this._update(props); | ||
return up; | ||
})).then(results => getCombinedResult(this, results)); | ||
} | ||
@@ -1476,3 +1490,5 @@ | ||
get idle() { | ||
return !this._state.asyncTo && Object.values(this.springs).every(spring => spring.idle); | ||
return !this._state.asyncTo && Object.values(this.springs).every(spring => { | ||
return spring.idle && !spring.isDelayed && !spring.isPaused; | ||
}); | ||
} | ||
@@ -1479,0 +1495,0 @@ |
{ | ||
"name": "@react-spring/core", | ||
"version": "9.4.0-beta.3", | ||
"version": "9.4.0-beta.4", | ||
"main": "dist/react-spring-core.cjs.js", | ||
@@ -5,0 +5,0 @@ "module": "dist/react-spring-core.esm.js", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
259832
8010
44