bugfix...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2021-01-12 05:14:14 +03:00
parent 7e3d735d06
commit 5e09d5fe99
2 changed files with 7 additions and 3 deletions

View File

@ -1,6 +1,6 @@
{
"name": "ig-types",
"version": "6.0.8",
"version": "6.0.9",
"description": "Generic JavaScript types and type extensions...",
"main": "main.js",
"scripts": {

View File

@ -485,6 +485,7 @@ object.Constructor('Queue', Array, {
//
// NOTE: adding tasks via the [..] notation will not trigger the
// event...
// NOTE: the events will not be triggered on no-op calls...
//
// XXX add methods that can shorten the queue (like .pop()/.shift()/..)
// to test and trigger .queueEmpty()
@ -492,11 +493,13 @@ object.Constructor('Queue', Array, {
// introduce issues -- queue can change between task runs... (revise!)
push: function(...tasks){
var res = object.parentCall(Queue.prototype.push, this, ...tasks)
this.trigger('tasksAdded', tasks)
tasks.length > 0
&& this.trigger('tasksAdded', tasks)
return res },
unsift: function(...tasks){
var res = object.parentCall(Queue.prototype.unshift, this, ...tasks)
this.trigger('tasksAdded', tasks)
tasks.length > 0
&& this.trigger('tasksAdded', tasks)
return res },
splice: function(...args){
var l = this.length
@ -504,6 +507,7 @@ object.Constructor('Queue', Array, {
var tasks = args.slice(2)
tasks.length > 0
&& this.trigger('tasksAdded', tasks)
// length changed...
l != 0 && this.length == 0
&& this.trigger('queueEmpty')
return res },