mirror of
https://github.com/flynx/types.js.git
synced 2025-12-19 01:41:38 +00:00
bugfix...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
7e3d735d06
commit
5e09d5fe99
@ -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": {
|
||||
|
||||
@ -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 },
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user