Properly use delay from intval object.

This commit is contained in:
mmcwilliams 2019-10-30 23:36:04 -04:00
parent eed8905f29
commit d566c2160b
5 changed files with 6 additions and 6 deletions

File diff suppressed because one or more lines are too long

View File

@ -47,7 +47,7 @@ class Sequence {
let len = typeof options.len !== 'undefined' ? options.len : MAX_INTEGER;
let multiple = typeof options.multiple !== 'undefined' ? options.multiple : 1;
this.id = v4_1.default();
this.delay = typeof options.delay !== 'undefined' ? options.delay : 0;
this.delay = typeof options.delay !== 'undefined' ? options.delay : this.intval._state.delay;
this.count = 0;
this.active = true;
log.info({ id: this.id, started: true });

View File

@ -1 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/sequence/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAA;;;;;AAEZ,iDAA2B;AAC3B,MAAM,GAAG,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAC;AACrC,oCAAiC;AAEjC,MAAM,WAAW,GAAG,UAAU,CAAC;AAc/B,+BAA+B;AAC/B,MAAa,QAAQ;IAUpB;;;;QAII;IAEJ,YAAa,MAAY;QAbjB,WAAM,GAAa,KAAK,CAAA;QAExB,UAAK,GAAY,CAAC,CAAA;QAClB,UAAK,GAAY,CAAC,CAAA;QAiE1B;;YAEI;QACG,SAAI,GAAG;YACb,IAAI,CAAC,MAAM,GAAG,KAAK,CAAA;YACnB,IAAI,CAAC,KAAK,GAAG,CAAC,CAAA;YACd,IAAI,CAAC,KAAK,GAAG,CAAC,CAAA;YAEd,GAAG,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,EAAE,EAAG,IAAI,CAAC,EAAE,EAAE,OAAO,EAAG,IAAI,EAAE,CAAC,CAAA;QACpD,CAAC,CAAA;QA/DA,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,MAAM,CAAC,QAAQ,GAAG;YACtB,IAAI,IAAI,CAAC,MAAM,EAAE;gBAChB,IAAI,CAAC,IAAI,EAAE,CAAA;gBAC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EAAE,CAAC,EAAE,EAAE;oBAClC,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAA;oBACzB,GAAG,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,EAAE,EAAG,IAAI,CAAC,EAAE,EAAE,KAAK,EAAG,IAAI,CAAC,KAAK,EAAE,CAAC,CAAA;oBACvD,IAAI,CAAC,KAAK,EAAE,CAAA;iBACZ;aACD;iBAAM;gBACN,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAA;gBACzB,GAAG,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,EAAE,EAAG,IAAI,CAAC,EAAE,EAAE,KAAK,EAAG,IAAI,CAAC,KAAK,EAAE,CAAC,CAAA;gBACvD,IAAI,CAAC,KAAK,EAAE,CAAA;aACZ;YAGD,IAAI,IAAI,CAAC,KAAK,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC,EAAE;gBAClC,MAAM,aAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;aACvB;YAED,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;gBACjB,MAAK;aACL;SACD;QAED,IAAI,CAAC,IAAI,EAAE,CAAA;IACZ,CAAC;CAYD;AAjFD,4BAiFC;AAED,MAAM,CAAC,OAAO,GAAG,QAAQ,CAAA"}

View File

@ -526,7 +526,7 @@ export default class Intval {
}
if (dir) {
return new Promise (function (resolve, reject) {
return new Promise (function (resolve : Function, reject : Function) {
this._state.frame.cb = (len : number) => {
this._state.counter++
this._storeState()
@ -534,7 +534,7 @@ export default class Intval {
}
}.bind(this))
} else {
return new Promise (function (resolve, reject) {
return new Promise (function (resolve : Function, reject : Function) {
this._state.frame.cb = (len : number) => {
this._state.counter--
this._storeState()

View File

@ -58,7 +58,7 @@ export class Sequence {
let multiple : number = typeof options.multiple !== 'undefined' ? options.multiple : 1
this.id = uuid()
this.delay = typeof options.delay !== 'undefined' ? options.delay : 0
this.delay = typeof options.delay !== 'undefined' ? options.delay : this.intval._state.delay
this.count = 0
this.active = true