mirror of
https://github.com/zyphlar/doorlock.git
synced 2024-04-03 21:36:03 +00:00
let the door-open return fast
This commit is contained in:
parent
fcd9545890
commit
bee518e1ef
|
@ -7,12 +7,12 @@ module.exports = class Door {
|
||||||
return new Promise(success => {
|
return new Promise(success => {
|
||||||
console.log('OPEN DOOR!')
|
console.log('OPEN DOOR!')
|
||||||
const board = new Board(2)
|
const board = new Board(2)
|
||||||
|
success(board.allOn())
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
console.log('CLOSING DOOR!')
|
console.log('CLOSING DOOR!')
|
||||||
board.allOff()
|
board.allOff()
|
||||||
success()
|
success()
|
||||||
}, DELAY)
|
}, DELAY)
|
||||||
return board.allOn()
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user