minor rework of queue.clear()...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2020-12-01 22:37:02 +03:00
parent 82e1327e69
commit ce3faafc61
2 changed files with 6 additions and 2 deletions

View File

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

View File

@ -114,8 +114,12 @@ object.Constructor('Queue', Array, {
return handle(false) }
this.__state = 'stopped' }),
// XXX revise...
clear: events.Event('clear', function(){
this.splice(0, this.length) }),
this.splice(0, this.length)
if(this.state == 'running'){
this.trigger('queueEmpty')
this.trigger('stop') } }),
// events...