@react-spring/shared
Advanced tools
Comparing version 9.0.0-canary.808.14.192785c to 9.0.0-canary.808.15.d4e5904
@@ -39,5 +39,7 @@ "use strict"; | ||
var start = function (animation) { | ||
var index = animations.findIndex(function (other) { return other.priority > animation.priority; }); | ||
animations.splice(~index ? index : animations.length, 0, animation); | ||
kickoff(); | ||
var index = animations.indexOf(animation); | ||
if (index < 0) { | ||
index = animations.findIndex(function (other) { return other.priority > animation.priority; }); | ||
animations.splice(~index ? index : animations.length, 0, animation); | ||
} | ||
}; | ||
@@ -103,6 +105,2 @@ // Start the frameloop | ||
this.start = function (animation) { | ||
var index = animations.indexOf(animation); | ||
if (~index) { | ||
animations.splice(index, 1); | ||
} | ||
if (priority > animation.priority) { | ||
@@ -113,2 +111,3 @@ startQueue.add(animation); | ||
start(animation); | ||
kickoff(); | ||
} | ||
@@ -115,0 +114,0 @@ }; |
@@ -19,10 +19,13 @@ /// <reference types="react" /> | ||
export declare const isAnimatedString: (value: unknown) => value is string; | ||
interface EachFn { | ||
<T = any, This = any>(arr: readonly T[], cb: (this: This, value: T, index: number) => void, ctx?: This): void; | ||
<T = any, This = any>(obj: ReadonlySet<T> | readonly T[], cb: (this: This, value: T) => void, ctx?: This): void; | ||
<P = any, T = any, This = any>(obj: ReadonlyMap<P, T>, cb: (this: This, value: T, key: P) => void, ctx?: This): void; | ||
<T extends Indexable = any, This = any>(obj: T, cb: (this: This, value: T[keyof T], key: keyof T) => void, ctx?: This): void; | ||
} | ||
declare type Eachable<Value, Key> = { | ||
forEach: (cb: (value: Value, key: Key) => void, ctx?: any) => void; | ||
}; | ||
declare type InferKey<T extends object> = T extends Eachable<any, infer Key> ? Key : Extract<keyof T, string>; | ||
declare type InferValue<T extends object> = T extends Eachable<infer Value, any> | { | ||
[key: string]: infer Value; | ||
} ? Value : never; | ||
/** An unsafe object/array/set iterator that allows for better minification */ | ||
export declare const each: EachFn; | ||
export declare const each: <T extends object, This>(obj: T & { | ||
forEach?: Function | undefined; | ||
}, cb: (this: This, value: InferValue<T>, key: InferKey<T>) => void, ctx?: This | undefined) => void; | ||
export declare const toArray: <T>(a: T) => Exclude<T, void> extends readonly any[] ? (readonly any[] & Exclude<T, void>)[number][] extends readonly any[] & Exclude<T, void> ? readonly (Exclude<T, void> extends readonly (infer U)[] ? U : Exclude<T, void>)[] : readonly any[] & Exclude<T, void> : readonly (Exclude<T, void> extends readonly (infer U_1)[] ? U_1 : Exclude<T, void>)[]; | ||
@@ -29,0 +32,0 @@ export declare const useOnce: (effect: import("react").EffectCallback) => void; |
@@ -53,3 +53,5 @@ "use strict"; | ||
else { | ||
Object.keys(obj).forEach(function (key) { return cb.call(ctx, obj[key], key); }); | ||
Object.keys(obj).forEach(function (key) { | ||
return cb.call(ctx, obj[key], key); | ||
}); | ||
} | ||
@@ -56,0 +58,0 @@ }; |
{ | ||
"name": "@react-spring/shared", | ||
"version": "9.0.0-canary.808.14.192785c", | ||
"version": "9.0.0-canary.808.15.d4e5904", | ||
"description": "Globals and shared modules", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/react-spring/react-spring/tree/master/packages/shared#readme", |
import { FluidValue } from 'fluids'; | ||
/** Add the `FluidValue` type to every property */ | ||
export declare type FluidProps<T> = T extends object ? { | ||
[P in keyof T]: T[P] | FluidValue<T[P]>; | ||
[P in keyof T]: T[P] | FluidValue<Exclude<T[P], void>>; | ||
} : unknown; | ||
@@ -6,0 +6,0 @@ /** These types can be animated */ |
@@ -13,5 +13,5 @@ export declare type Indexable<T = any> = { | ||
/** For resolving object intersections */ | ||
export declare type Remap<T> = Solve<{ | ||
export declare type Remap<T> = {} & { | ||
[P in keyof T]: T[P]; | ||
}>; | ||
}; | ||
/** Override the property types of `A` with `B` and merge any new properties */ | ||
@@ -18,0 +18,0 @@ export declare type Merge<A, B> = Remap<{ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
1275
110682