I came across this code snippet from an example in rxjs:
Observable.fromEvent(this.getNativeElement(this.right), 'click')
.map(event => 10)
.startWith({x: 400, y: 400})
.scan((acc, curr) => Object.assign({}, acc, {x: acc.x + curr}))
.subscribe(position => this.position = position);
However, I encountered a Typescript error:
[ts] Argument of type '{ x: number; y: number; }' is not assignable to parameter of type 'number | Scheduler'.
Object literal may only specify known properties, and 'x' does not exist in type 'number | Scheduler'.
Any tips on resolving this issue?