Push dev work to master #2
|
@ -59,6 +59,7 @@ sequence.stop = function () {
|
|||
|
||||
if (sequence._state.stop) sequence._state.stop()
|
||||
if (sequence._state.input) sequence._state.input()
|
||||
|
||||
sequence._state.stop = null
|
||||
sequence._state.input = null
|
||||
}
|
||||
|
@ -73,25 +74,26 @@ sequence.resume = function () {
|
|||
}
|
||||
|
||||
sequence.step = function () {
|
||||
log.info('step', `Started step ${sequence._state.count}`)
|
||||
if (sequence._state.active && !sequence._state.paused) {
|
||||
if (sequence._state.arr.length > 0) {
|
||||
if (sequence._state.count > sequence._state.arr.length) {
|
||||
if (sequence._state.count > sequence._state.arr.length - 1) {
|
||||
return sequence.stop()
|
||||
}
|
||||
log.info('step')
|
||||
log.info('step', sequence._state.count)
|
||||
return sequence._state.arr[sequence._state.count](() => {
|
||||
sequence._state.count++
|
||||
sequence.step()
|
||||
})
|
||||
} else if (sequence._loop.arr.length > 0) {
|
||||
if (sequence._state.count > sequence._loop.arr.length) {
|
||||
if (sequence._state.count > sequence._loop.arr.length - 1) {
|
||||
sequence._state.count = 0
|
||||
sequence._loop.count++
|
||||
}
|
||||
if (sequence._loop.max > 0 && sequence._loop.count > sequence._loop.max) {
|
||||
return sequence.stop()
|
||||
}
|
||||
log.info()
|
||||
log.info('step', sequence._state.count)
|
||||
return sequence._loop.arr[sequence._state.count](() => {
|
||||
sequence._state.count++
|
||||
sequence.step()
|
||||
|
|
Loading…
Reference in New Issue