Comparing version 2.3.0 to 2.3.1
@@ -8,2 +8,3 @@ import { IAction, IActionType, IChannel } from "./types"; | ||
private status; | ||
private front; | ||
private end; | ||
@@ -10,0 +11,0 @@ private afterEmpty; |
@@ -16,6 +16,8 @@ import { defer } from "./utils/defer"; | ||
this.status = 0 /* IDLE */; | ||
this.end = null; | ||
this.front = new Node("", null); | ||
this.end = this.front; | ||
this.drainDefer = defer(() => { | ||
this.status = 2 /* DRAINING */; | ||
let iter = this.end; | ||
let iter = this.front.next; | ||
this.front.next = null; // release chain while we're iterating | ||
while (iter !== null) { | ||
@@ -28,3 +30,3 @@ const chain = this.eventLists.get(iter.type); | ||
} | ||
this.end = null; | ||
this.end = this.front; | ||
this.status = 0 /* IDLE */; | ||
@@ -36,9 +38,3 @@ this.afterEmpty(); | ||
put(action) { | ||
if (this.end !== null) { | ||
this.end.next = new Node(action.type, action.payload); | ||
this.end = this.end.next; | ||
} | ||
else { | ||
this.end = new Node(action.type, action.payload); | ||
} | ||
this.end = this.end.next = new Node(action.type, action.payload); | ||
if (this.status === 0 /* IDLE */) { | ||
@@ -45,0 +41,0 @@ this.status = 1 /* SCHEDULED */; |
@@ -19,6 +19,8 @@ "use strict"; | ||
this.status = 0 /* IDLE */; | ||
this.end = null; | ||
this.front = new Node("", null); | ||
this.end = this.front; | ||
this.drainDefer = defer_1.defer(() => { | ||
this.status = 2 /* DRAINING */; | ||
let iter = this.end; | ||
let iter = this.front.next; | ||
this.front.next = null; // release chain while we're iterating | ||
while (iter !== null) { | ||
@@ -31,3 +33,3 @@ const chain = this.eventLists.get(iter.type); | ||
} | ||
this.end = null; | ||
this.end = this.front; | ||
this.status = 0 /* IDLE */; | ||
@@ -39,9 +41,3 @@ this.afterEmpty(); | ||
put(action) { | ||
if (this.end !== null) { | ||
this.end.next = new Node(action.type, action.payload); | ||
this.end = this.end.next; | ||
} | ||
else { | ||
this.end = new Node(action.type, action.payload); | ||
} | ||
this.end = this.end.next = new Node(action.type, action.payload); | ||
if (this.status === 0 /* IDLE */) { | ||
@@ -48,0 +44,0 @@ this.status = 1 /* SCHEDULED */; |
{ | ||
"name": "tinysaga", | ||
"version": "2.3.0", | ||
"version": "2.3.1", | ||
"main": "lib/index.js", | ||
@@ -5,0 +5,0 @@ "module": "esm/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
35138
897