knowyt/client/src/composables/engine/startStop.ts

16 lines
421 B
TypeScript
Raw Normal View History

export function start(): void {
if (this.isActive.value && !this.shouldStop.value) {
console.warn('attempt to start already running engine!')
return
}
this.isActive.value = true
this.shouldStop.value = false
console.log('start engine')
}
export function stop(): void {
if (this.isActive.value) {
this.shouldStop.value = true
console.log('shut down engine')
}
}