diff --git a/package.json b/package.json index 50e4097..bfb8aa0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ig-stoppable", - "version": "1.0.0", + "version": "2.0.0", "description": "Utility library implementing tooling to make stoppable functions...", "main": "stoppable.js", "scripts": { diff --git a/stoppable.js b/stoppable.js index 95ebe06..0a955a7 100644 --- a/stoppable.js +++ b/stoppable.js @@ -26,19 +26,6 @@ var AsyncGenerator = -//--------------------------------------------------------------------- - -var STOP = -module.STOP = -function(value){ - return { - __proto__: STOP.prototype, - doc: 'stop iteration.', - value, - } } - - - //--------------------------------------------------------------------- // Wrap a callable in a STOP handler @@ -76,8 +63,7 @@ function(value){ // // NOTE: this repeats the same code at lest twice, not sure yet how to avoid // this... -var stoppable = -module.stoppable = +module = function(func){ return Object.assign( func instanceof Generator ? @@ -140,5 +126,17 @@ function(func){ +//--------------------------------------------------------------------- + +module.STOP = +function(value){ + return { + __proto__: module.STOP.prototype, + doc: 'stop iteration.', + value, + } } + + + /********************************************************************** * vim:set ts=4 sw=4 nowrap : */ return module })