Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

aurelia-task-queue

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aurelia-task-queue - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

2

bower.json
{
"name": "aurelia-task-queue",
"version": "1.0.0",
"version": "1.1.0",
"description": "A simple task queue for the browser that enables the queuing of both standard tasks and micro tasks.",

@@ -5,0 +5,0 @@ "keywords": [

@@ -57,2 +57,4 @@ define(['exports', 'aurelia-pal'], function (exports, _aureliaPal) {

this.flushing = false;
this.microTaskQueue = [];

@@ -101,2 +103,3 @@ this.microTaskQueueCapacity = 1024;

try {
this.flushing = true;
while (index < queue.length) {

@@ -109,2 +112,4 @@ task = queue[index];

onError(error, task);
} finally {
this.flushing = false;
}

@@ -120,2 +125,3 @@ };

try {
this.flushing = true;
while (index < queue.length) {

@@ -137,2 +143,4 @@ task = queue[index];

onError(error, task);
} finally {
this.flushing = false;
}

@@ -139,0 +147,0 @@

@@ -26,2 +26,7 @@ import {

/**
* Whether the queue is in the process of flushing.
*/
flushing: any;
/**
* Creates an instance of TaskQueue.

@@ -28,0 +33,0 @@ */

@@ -62,2 +62,7 @@ import {DOM,FEATURE} from 'aurelia-pal';

/**
* Whether the queue is in the process of flushing.
*/
flushing = false;
/**
* Creates an instance of TaskQueue.

@@ -114,2 +119,3 @@ */

try {
this.flushing = true;
while (index < queue.length) {

@@ -122,2 +128,4 @@ task = queue[index];

onError(error, task);
} finally {
this.flushing = false;
}

@@ -136,2 +144,3 @@ }

try {
this.flushing = true;
while (index < queue.length) {

@@ -160,2 +169,4 @@ task = queue[index];

onError(error, task);
} finally {
this.flushing = false;
}

@@ -162,0 +173,0 @@

@@ -58,2 +58,4 @@ 'use strict';

this.flushing = false;
this.microTaskQueue = [];

@@ -102,2 +104,3 @@ this.microTaskQueueCapacity = 1024;

try {
this.flushing = true;
while (index < queue.length) {

@@ -110,2 +113,4 @@ task = queue[index];

onError(error, task);
} finally {
this.flushing = false;
}

@@ -121,2 +126,3 @@ };

try {
this.flushing = true;
while (index < queue.length) {

@@ -138,2 +144,4 @@ task = queue[index];

onError(error, task);
} finally {
this.flushing = false;
}

@@ -140,0 +148,0 @@

@@ -45,2 +45,4 @@ import { DOM, FEATURE } from 'aurelia-pal';

constructor() {
this.flushing = false;
this.microTaskQueue = [];

@@ -83,2 +85,3 @@ this.microTaskQueueCapacity = 1024;

try {
this.flushing = true;
while (index < queue.length) {

@@ -91,2 +94,4 @@ task = queue[index];

onError(error, task);
} finally {
this.flushing = false;
}

@@ -102,2 +107,3 @@ }

try {
this.flushing = true;
while (index < queue.length) {

@@ -119,2 +125,4 @@ task = queue[index];

onError(error, task);
} finally {
this.flushing = false;
}

@@ -121,0 +129,0 @@

@@ -51,2 +51,4 @@

this.flushing = false;
this.microTaskQueue = [];

@@ -95,2 +97,3 @@ this.microTaskQueueCapacity = 1024;

try {
this.flushing = true;
while (index < queue.length) {

@@ -103,2 +106,4 @@ task = queue[index];

onError(error, task);
} finally {
this.flushing = false;
}

@@ -114,2 +119,3 @@ };

try {
this.flushing = true;
while (index < queue.length) {

@@ -131,2 +137,4 @@ task = queue[index];

onError(error, task);
} finally {
this.flushing = false;
}

@@ -133,0 +141,0 @@

@@ -62,2 +62,4 @@ 'use strict';

this.flushing = false;
this.microTaskQueue = [];

@@ -106,2 +108,3 @@ this.microTaskQueueCapacity = 1024;

try {
this.flushing = true;
while (index < queue.length) {

@@ -114,2 +117,4 @@ task = queue[index];

onError(error, task);
} finally {
this.flushing = false;
}

@@ -125,2 +130,3 @@ };

try {
this.flushing = true;
while (index < queue.length) {

@@ -142,2 +148,4 @@ task = queue[index];

onError(error, task);
} finally {
this.flushing = false;
}

@@ -144,0 +152,0 @@

@@ -1,1 +0,1 @@

{"name":"aurelia-task-queue","children":[{"id":5,"name":"TaskQueue","kind":128,"kindString":"Class","flags":{"isExported":true},"comment":{"shortText":"Implements an asynchronous task queue."},"children":[{"id":6,"name":"constructor","kind":512,"kindString":"Constructor","flags":{"isExported":true},"comment":{"shortText":"Creates an instance of TaskQueue."},"signatures":[{"id":7,"name":"new TaskQueue","kind":16384,"kindString":"Constructor signature","flags":{},"comment":{"shortText":"Creates an instance of TaskQueue."},"type":{"type":"reference","name":"TaskQueue","id":5}}]},{"id":16,"name":"flushMicroTaskQueue","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":17,"name":"flushMicroTaskQueue","kind":4096,"kindString":"Call signature","flags":{},"comment":{"shortText":"Immediately flushes the micro task queue."},"type":{"type":"instrinct","name":"void"}}]},{"id":14,"name":"flushTaskQueue","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":15,"name":"flushTaskQueue","kind":4096,"kindString":"Call signature","flags":{},"comment":{"shortText":"Immediately flushes the task queue."},"type":{"type":"instrinct","name":"void"}}]},{"id":8,"name":"queueMicroTask","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":9,"name":"queueMicroTask","kind":4096,"kindString":"Call signature","flags":{},"comment":{"shortText":"Queues a task on the micro task queue for ASAP execution."},"parameters":[{"id":10,"name":"task","kind":32768,"kindString":"Parameter","flags":{},"comment":{"text":"The task to queue up for ASAP execution.\n"},"type":{"type":"union","types":[{"type":"reference","name":"Task","id":2},{"type":"reference","name":"Function"}]}}],"type":{"type":"instrinct","name":"void"}}]},{"id":11,"name":"queueTask","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":12,"name":"queueTask","kind":4096,"kindString":"Call signature","flags":{},"comment":{"shortText":"Queues a task on the macro task queue for turn-based execution."},"parameters":[{"id":13,"name":"task","kind":32768,"kindString":"Parameter","flags":{},"comment":{"text":"The task to queue up for turn-based execution.\n"},"type":{"type":"union","types":[{"type":"reference","name":"Task","id":2},{"type":"reference","name":"Function"}]}}],"type":{"type":"instrinct","name":"void"}}]}],"groups":[{"title":"Constructors","kind":512,"children":[6]},{"title":"Methods","kind":2048,"children":[16,14,8,11]}]},{"id":2,"name":"Task","kind":256,"kindString":"Interface","flags":{"isExported":true},"comment":{"shortText":"Either a Function or a class with a call method that will do work when dequeued."},"children":[{"id":3,"name":"call","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":4,"name":"call","kind":4096,"kindString":"Call signature","flags":{},"comment":{"shortText":"Call it."},"type":{"type":"instrinct","name":"void"}}]}],"groups":[{"title":"Methods","kind":2048,"children":[3]}]}],"groups":[{"title":"Classes","kind":128,"children":[5]},{"title":"Interfaces","kind":256,"children":[2]}]}
{"name":"aurelia-task-queue","children":[{"id":5,"name":"TaskQueue","kind":128,"kindString":"Class","flags":{"isExported":true},"comment":{"shortText":"Implements an asynchronous task queue."},"children":[{"id":7,"name":"constructor","kind":512,"kindString":"Constructor","flags":{"isExported":true},"comment":{"shortText":"Creates an instance of TaskQueue."},"signatures":[{"id":8,"name":"new TaskQueue","kind":16384,"kindString":"Constructor signature","flags":{},"comment":{"shortText":"Creates an instance of TaskQueue."},"type":{"type":"reference","name":"TaskQueue","id":5}}]},{"id":6,"name":"flushing","kind":1024,"kindString":"Property","flags":{"isExported":true},"comment":{"shortText":"Whether the queue is in the process of flushing."},"type":{"type":"instrinct","name":"any"}},{"id":17,"name":"flushMicroTaskQueue","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":18,"name":"flushMicroTaskQueue","kind":4096,"kindString":"Call signature","flags":{},"comment":{"shortText":"Immediately flushes the micro task queue."},"type":{"type":"instrinct","name":"void"}}]},{"id":15,"name":"flushTaskQueue","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":16,"name":"flushTaskQueue","kind":4096,"kindString":"Call signature","flags":{},"comment":{"shortText":"Immediately flushes the task queue."},"type":{"type":"instrinct","name":"void"}}]},{"id":9,"name":"queueMicroTask","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":10,"name":"queueMicroTask","kind":4096,"kindString":"Call signature","flags":{},"comment":{"shortText":"Queues a task on the micro task queue for ASAP execution."},"parameters":[{"id":11,"name":"task","kind":32768,"kindString":"Parameter","flags":{},"comment":{"text":"The task to queue up for ASAP execution.\n"},"type":{"type":"union","types":[{"type":"reference","name":"Task","id":2},{"type":"reference","name":"Function"}]}}],"type":{"type":"instrinct","name":"void"}}]},{"id":12,"name":"queueTask","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":13,"name":"queueTask","kind":4096,"kindString":"Call signature","flags":{},"comment":{"shortText":"Queues a task on the macro task queue for turn-based execution."},"parameters":[{"id":14,"name":"task","kind":32768,"kindString":"Parameter","flags":{},"comment":{"text":"The task to queue up for turn-based execution.\n"},"type":{"type":"union","types":[{"type":"reference","name":"Task","id":2},{"type":"reference","name":"Function"}]}}],"type":{"type":"instrinct","name":"void"}}]}],"groups":[{"title":"Constructors","kind":512,"children":[7]},{"title":"Properties","kind":1024,"children":[6]},{"title":"Methods","kind":2048,"children":[17,15,9,12]}]},{"id":2,"name":"Task","kind":256,"kindString":"Interface","flags":{"isExported":true},"comment":{"shortText":"Either a Function or a class with a call method that will do work when dequeued."},"children":[{"id":3,"name":"call","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":4,"name":"call","kind":4096,"kindString":"Call signature","flags":{},"comment":{"shortText":"Call it."},"type":{"type":"instrinct","name":"void"}}]}],"groups":[{"title":"Methods","kind":2048,"children":[3]}]}],"groups":[{"title":"Classes","kind":128,"children":[5]},{"title":"Interfaces","kind":256,"children":[2]}]}

@@ -0,1 +1,11 @@

<a name="1.1.0"></a>
# [1.1.0](https://github.com/aurelia/task-queue/compare/1.0.0...v1.1.0) (2016-09-29)
### Features
* **TaskQueue:** expose flushing status ([fdf0bd7](https://github.com/aurelia/task-queue/commit/fdf0bd7))
<a name="1.0.0"></a>

@@ -2,0 +12,0 @@ # [1.0.0](https://github.com/aurelia/task-queue/compare/1.0.0-rc.1.0.0...v1.0.0) (2016-07-27)

@@ -9,4 +9,4 @@ <!--

Durandal Inc. offers paid support agreements. Further information regarding paid support
may be obtained by emailing support@durandal.io
Blue Spire offers paid support agreements. Further information regarding paid support
may be obtained by emailing support@bluespire.com

@@ -13,0 +13,0 @@ Future support requests submitted here will be closed.

{
"name": "aurelia-task-queue",
"version": "1.0.0",
"version": "1.1.0",
"description": "A simple task queue for the browser that enables the queuing of both standard tasks and micro tasks.",

@@ -5,0 +5,0 @@ "keywords": [

@@ -10,3 +10,3 @@ # aurelia-task-queue

> To keep up to date on [Aurelia](http://www.aurelia.io/), please visit and subscribe to [the official blog](http://blog.durandal.io/) and [our email list](http://durandal.us10.list-manage1.com/subscribe?u=dae7661a3872ee02b519f6f29&id=3de6801ccc). We also invite you to [follow us on twitter](https://twitter.com/aureliaeffect). If you have questions, please [join our community on Gitter](https://gitter.im/aurelia/discuss). If you would like to have deeper insight into our development process, please install the [ZenHub](https://zenhub.io) Chrome or Firefox Extension and visit any of our repository's boards. You can get an overview of all Aurelia work by visiting [the framework board](https://github.com/aurelia/framework#boards).
> To keep up to date on [Aurelia](http://www.aurelia.io/), please visit and subscribe to [the official blog](http://blog.aurelia.io/) and [our email list](http://eepurl.com/ces50j). We also invite you to [follow us on twitter](https://twitter.com/aureliaeffect). If you have questions, please [join our community on Gitter](https://gitter.im/aurelia/discuss) or use [stack overflow](http://stackoverflow.com/search?q=aurelia). Documentation can be found [in our developer hub](http://aurelia.io/hub.html). If you would like to have deeper insight into our development process, please install the [ZenHub](https://zenhub.io) Chrome or Firefox Extension and visit any of our repository's boards.

@@ -13,0 +13,0 @@ ## Platform Support

@@ -62,2 +62,7 @@ import {DOM, FEATURE} from 'aurelia-pal';

/**
* Whether the queue is in the process of flushing.
*/
flushing = false;
/**
* Creates an instance of TaskQueue.

@@ -114,2 +119,3 @@ */

try {
this.flushing = true;
while (index < queue.length) {

@@ -122,2 +128,4 @@ task = queue[index];

onError(error, task);
} finally {
this.flushing = false;
}

@@ -136,2 +144,3 @@ }

try {
this.flushing = true;
while (index < queue.length) {

@@ -160,2 +169,4 @@ task = queue[index];

onError(error, task);
} finally {
this.flushing = false;
}

@@ -162,0 +173,0 @@

@@ -22,12 +22,18 @@ import {TaskQueue} from '../src/index';

it("will execute tasks in the correct order", done => {
let queue = new TaskQueue();
let task1HasRun = false;
let task1 = () => {
expect(queue.flushing).toBe(true);
task1HasRun = true;
};
let task2 = () => {
expect(queue.flushing).toBe(true);
expect(task1HasRun).toEqual(true);
done();
setTimeout(() => {
expect(queue.flushing).toBe(false);
done();
});
};
let queue = new TaskQueue();
expect(queue.flushing).toBe(false);
queue.queueTask(task1);

@@ -38,5 +44,6 @@ queue.queueTask(task2);

it("will use an onError handler on a task", done => {
let queue = new TaskQueue();
let count = 0;
let task = () => {
expect(queue.flushing).toBe(true);
throw new Error("oops");

@@ -47,10 +54,11 @@ };

expect(ex.message).toBe("oops");
done();
setTimeout(() => {
expect(queue.flushing).toBe(false);
done();
});
};
let queue = new TaskQueue();
expect(queue.flushing).toBe(false);
queue.queueTask(task);
});
});

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc