Skip to content

Commit b4f06f5

Browse files
committed
2 parents 1a7956e + 8a1aab9 commit b4f06f5

File tree

5 files changed

+32
-14
lines changed

5 files changed

+32
-14
lines changed

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,14 @@
8080
"husky": "1.3.1",
8181
"jest": "24.1.0",
8282
"json": "9.0.6",
83+
"konva": "^2.6.0",
8384
"lint-staged": "8.1.3",
8485
"mock-raf": "1.0.1",
8586
"npm-run-all": "4.1.5",
8687
"prettier": "1.16.4",
8788
"react": "16.8.1",
8889
"react-dom": "16.8.1",
90+
"react-konva": "^16.7.1",
8991
"react-test-renderer": "16.8.1",
9092
"react-testing-library": "5.6.0",
9193
"rimraf": "2.6.3",

src/animated/Controller.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ export default class Controller {
122122
return this
123123
}
124124

125-
stop(finished, noChange) {
125+
stop(finished) {
126126
this.listeners.forEach(onEnd => onEnd(finished))
127127
this.listeners = []
128128
return this

src/animated/FrameLoop.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ const controllers = new Set()
77
const frameLoop = () => {
88
let time = now()
99
for (let controller of controllers) {
10-
let noChange = true
1110
let isActive = false
1211

1312
for (
@@ -39,9 +38,6 @@ const frameLoop = () => {
3938
continue
4039
}
4140

42-
// Flag change
43-
noChange = false
44-
4541
// Break animation when string values are involved
4642
if (typeof from === 'string' || typeof to === 'string') {
4743
animation.updateValue(to)
@@ -124,7 +120,7 @@ const frameLoop = () => {
124120
// Either call onEnd or next frame
125121
if (!isActive) {
126122
controllers.delete(controller)
127-
controller.stop(true, noChange)
123+
controller.stop(true)
128124
}
129125
}
130126

src/shared/helpers.ts

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,29 @@ export function callProp<T>(
4848
return is.fun(obj) ? obj(...args) : obj
4949
}
5050

51-
function getForwardProps(props: any) {
51+
type PartialExcludedProps = Partial<{
52+
to: any,
53+
from: any,
54+
config: any,
55+
onStart: any,
56+
onRest: any,
57+
onFrame: any,
58+
children: any,
59+
reset: any,
60+
reverse: any,
61+
force: any,
62+
immediate: any,
63+
delay: any,
64+
attach: any,
65+
destroyed: any,
66+
interpolateTo: any,
67+
ref: any,
68+
lazy: any
69+
}> & object;
70+
71+
export type ForwardedProps<T> = Pick<T, Exclude<keyof T, keyof PartialExcludedProps>>
72+
73+
function getForwardProps<P extends PartialExcludedProps>(props: P): ForwardedProps<P> {
5274
const {
5375
to,
5476
from,

types/web.d.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ type ExcludedProps =
1616
| 'to'
1717
| 'from'
1818
| 'config'
19-
| 'native'
2019
| 'onStart'
2120
| 'onRest'
2221
| 'onFrame'
@@ -25,15 +24,12 @@ type ExcludedProps =
2524
| 'reverse'
2625
| 'force'
2726
| 'immediate'
28-
| 'impl'
29-
| 'inject'
3027
| 'delay'
3128
| 'attach'
3229
| 'destroyed'
33-
| 'track'
3430
| 'interpolateTo'
35-
| 'autoStart'
3631
| 'ref'
32+
| 'lazy'
3733

3834
// The config options for an interoplation. It maps out from in "in" type
3935
// to an "out" type.
@@ -213,14 +209,16 @@ export function useTransition<TItem, DS extends CSSProperties>(
213209
keys:
214210
| ((item: TItem) => TransitionKeyProps)
215211
| ReadonlyArray<TransitionKeyProps>
216-
| TransitionKeyProps,
212+
| TransitionKeyProps
213+
| null,
217214
values: Merge<DS & CSSProperties, UseTransitionProps<TItem, DS>>
218215
): UseTransitionResult<TItem, ForwardedProps<DS>>[] // result array is safe to modify
219216
export function useTransition<TItem, DS extends object>(
220217
items: ReadonlyArray<TItem> | TItem | null | undefined,
221218
keys:
222219
| ((item: TItem) => TransitionKeyProps)
223220
| ReadonlyArray<TransitionKeyProps>
224-
| TransitionKeyProps,
221+
| TransitionKeyProps
222+
| null,
225223
values: Merge<DS, UseTransitionProps<TItem, DS>>
226224
): UseTransitionResult<TItem, AnimatedValue<ForwardedProps<DS>>>[] // result array is safe to modify

0 commit comments

Comments
 (0)