I am using the svelte.js framework
and I am using a function that returns an object like this {x, y, rotated, isMoving}
the problem is that isMoving use getter
{
get isMoving() {
return Object.values(this)
}
}
basically I want all the values to be in a array and then loop on it.
function activeAxis() {
return {
x: x !== prevCoords.x && y === prevCoords.y,
y: y !== prevCoords.y && x === prevCoords.x,
rotated: y !== prevCoords.y && x !== prevCoords.x,
get isMoving() {
return Object.values(this)
}
};
}
the array is a series of points with x and y
like this:
let array = [{
x: 10
y: 20
},
{
x: 15
y: 20
},
{
x: 25,
y: 9
},
{
x: 25,
y: 30
},
{
x: 25,
y: 25
},
{
x: 25
y: 25
}
]
