Skip to content

Commit c651c2b

Browse files
committed
Remove unused argument from Controller constructor
1 parent c38f265 commit c651c2b

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/animated/Controller.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ test('update simple value', () => {
77
Globals.injectFrame(mockRaf.raf, mockRaf.cancel)
88
Globals.injectNow(mockRaf.now)
99

10-
const ctrl = new Controller() as any
10+
const ctrl = new Controller<{ x: number; y?: number }>()
1111
ctrl.update({ x: 0 })
1212
ctrl.start()
1313
expect(ctrl.getValues().x.getValue()).toBe(0)
@@ -29,7 +29,7 @@ test('update array value', () => {
2929
Globals.injectFrame(mockRaf.raf, mockRaf.cancel)
3030
Globals.injectNow(mockRaf.now)
3131

32-
const ctrl = new Controller() as any
32+
const ctrl = new Controller<{ x: number[] }>()
3333
ctrl.update({ x: [0, 0] })
3434
ctrl.start()
3535
expect(ctrl.getValues().x.getValue()).toEqual([0, 0])

src/animated/Controller.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,8 @@ class Controller<P extends any = {}> {
4040
queue: any[] = []
4141
localQueue?: any[]
4242

43-
constructor(props?: P) {
43+
constructor() {
4444
this.id = G++
45-
if (props) this.update(props)
4645
}
4746

4847
/** update(props)

0 commit comments

Comments
 (0)