Comparing version 1.0.0 to 1.0.1
@@ -11,2 +11,3 @@ /** | ||
* | ||
* @private | ||
* @param {Function} next Next callback in the system to be invoked. | ||
@@ -36,3 +37,3 @@ * @return {Function} Completion callback, first argument is error, subsequent arguments are passed down the chain. | ||
if (next) { | ||
args.push(system.createDoneCallback(this.steps.shift())) | ||
args.unshift(system.createDoneCallback(system.steps.shift())) | ||
next.apply(this, args) | ||
@@ -44,3 +45,3 @@ } else { | ||
system.check() | ||
system.check(true) | ||
} | ||
@@ -50,19 +51,35 @@ } | ||
/** | ||
* Starts the next task to be completed. | ||
* | ||
* @private | ||
* @return {void} | ||
*/ | ||
Breeze.prototype.run = function _breezeRun () { | ||
var args = this.args || [] | ||
this.running = true | ||
func = this.steps.shift() | ||
args.unshift(this.createDoneCallback(this.steps.shift())) | ||
func.apply(this.context, args) | ||
} | ||
/** | ||
* Checks whether the system is running, needs to be ran, or has completed | ||
* running. | ||
* | ||
* @private | ||
* @return {void} | ||
*/ | ||
Breeze.prototype.check = function _breezeCheck () { | ||
var func | ||
Breeze.prototype.check = function _breezeCheck (pop) { | ||
if (pop) { | ||
if (this.steps.length) { | ||
this.run() | ||
} else { | ||
this.running = false | ||
} | ||
args = this.args || [] | ||
return | ||
} | ||
if (!this.running && this.steps.length) { | ||
this.running = true | ||
func = this.steps.shift() | ||
args.unshift(this.createDoneCallback(this.steps.shift())) | ||
func.apply(this.context, args) | ||
} else if (this.running && !this.steps.length) { | ||
this.running = false | ||
if (this.steps.length && !this.running) { | ||
this.run() | ||
} | ||
@@ -69,0 +86,0 @@ } |
{ | ||
"name": "breeze", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Functional async flow control library", | ||
@@ -5,0 +5,0 @@ "main": "breeze.js", |
@@ -7,6 +7,3 @@ # Breeze | ||
[![License][npm-license]][license-url] | ||
[![Build Status][travis-image]][travis-url] | ||
[![Downloads][npm-downloads]][npm-url] | ||
[![Code Climate][codeclimate-quality]][codeclimate-url] | ||
[![Coverage Status][codeclimate-coverage]][codeclimate-url] | ||
[![Dependencies][david-image]][david-url] | ||
@@ -84,3 +81,2 @@ | ||
[download]: https://github.com/Nijikokun/breeze/archive/v1.0.0.zip | ||
[mithril]: https://github.com/lhorie/mithril.js | ||
[download]: https://github.com/Nijikokun/breeze/archive/v1.0.1.zip |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
8228
5
169
0
81