greenlet
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -1,2 +0,2 @@ | ||
module.exports=function(e){var n=0,t={},a=new Worker("data:,$$="+e+";onmessage="+function(e){Promise.resolve().then($$.bind.apply($$,e.data)).then(function(n){postMessage([e.data[0],0,n],[n].filter(function(e){return e instanceof ArrayBuffer||e instanceof MessagePort||e instanceof ImageBitmap}))},function(n){postMessage([e.data[0],1,""+n])})});return a.onmessage=function(e){t[e.data[0]][e.data[1]](e.data[2]),t[e.data[0]]=null},function(e){return e=[].slice.call(arguments),new Promise(function(){t[++n]=arguments,a.postMessage([n,e],e.filter(function(e){return e instanceof ArrayBuffer||e instanceof MessagePort||e instanceof ImageBitmap}))})}}; | ||
module.exports=function(n){var e=0,t={},a=new Worker("data:,$$="+n+";onmessage="+function(n){Promise.resolve(n.data[1]).then(function(n){return $$.apply($$,n)}).then(function(e){postMessage([n.data[0],0,e],[e].filter(function(n){return n instanceof ArrayBuffer||n instanceof MessagePort||n instanceof ImageBitmap}))},function(e){postMessage([n.data[0],1,""+e])})});return a.onmessage=function(n){t[n.data[0]][n.data[1]](n.data[2]),t[n.data[0]]=null},function(n){return n=[].slice.call(arguments),new Promise(function(){t[++e]=arguments,a.postMessage([e,n],n.filter(function(n){return n instanceof ArrayBuffer||n instanceof MessagePort||n instanceof ImageBitmap}))})}}; | ||
//# sourceMappingURL=greenlet.js.map |
@@ -1,2 +0,2 @@ | ||
export default function(e){var n=0,t={},a=new Worker("data:,$$="+e+";onmessage="+function(e){Promise.resolve().then($$.bind.apply($$,e.data)).then(function(n){postMessage([e.data[0],0,n],[n].filter(function(e){return e instanceof ArrayBuffer||e instanceof MessagePort||e instanceof ImageBitmap}))},function(n){postMessage([e.data[0],1,""+n])})});return a.onmessage=function(e){t[e.data[0]][e.data[1]](e.data[2]),t[e.data[0]]=null},function(e){return e=[].slice.call(arguments),new Promise(function(){t[++n]=arguments,a.postMessage([n,e],e.filter(function(e){return e instanceof ArrayBuffer||e instanceof MessagePort||e instanceof ImageBitmap}))})}}; | ||
export default function(n){var e=0,t={},a=new Worker("data:,$$="+n+";onmessage="+function(n){Promise.resolve(n.data[1]).then(function(n){return $$.apply($$,n)}).then(function(e){postMessage([n.data[0],0,e],[e].filter(function(n){return n instanceof ArrayBuffer||n instanceof MessagePort||n instanceof ImageBitmap}))},function(e){postMessage([n.data[0],1,""+e])})});return a.onmessage=function(n){t[n.data[0]][n.data[1]](n.data[2]),t[n.data[0]]=null},function(n){return n=[].slice.call(arguments),new Promise(function(){t[++e]=arguments,a.postMessage([e,n],n.filter(function(n){return n instanceof ArrayBuffer||n instanceof MessagePort||n instanceof ImageBitmap}))})}}; | ||
//# sourceMappingURL=greenlet.m.js.map |
@@ -1,2 +0,2 @@ | ||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):e.greenlet=n()}(this,function(){return function(e){var n=0,t={},a=new Worker("data:,$$="+e+";onmessage="+function(e){Promise.resolve().then($$.bind.apply($$,e.data)).then(function(n){postMessage([e.data[0],0,n],[n].filter(function(e){return e instanceof ArrayBuffer||e instanceof MessagePort||e instanceof ImageBitmap}))},function(n){postMessage([e.data[0],1,""+n])})});return a.onmessage=function(e){t[e.data[0]][e.data[1]](e.data[2]),t[e.data[0]]=null},function(e){return e=[].slice.call(arguments),new Promise(function(){t[++n]=arguments,a.postMessage([n,e],e.filter(function(e){return e instanceof ArrayBuffer||e instanceof MessagePort||e instanceof ImageBitmap}))})}}}); | ||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):e.greenlet=n()}(this,function(){return function(e){var n=0,t={},a=new Worker("data:,$$="+e+";onmessage="+function(e){Promise.resolve(e.data[1]).then(function(e){return $$.apply($$,e)}).then(function(n){postMessage([e.data[0],0,n],[n].filter(function(e){return e instanceof ArrayBuffer||e instanceof MessagePort||e instanceof ImageBitmap}))},function(n){postMessage([e.data[0],1,""+n])})});return a.onmessage=function(e){t[e.data[0]][e.data[1]](e.data[2]),t[e.data[0]]=null},function(e){return e=[].slice.call(arguments),new Promise(function(){t[++n]=arguments,a.postMessage([n,e],e.filter(function(e){return e instanceof ArrayBuffer||e instanceof MessagePort||e instanceof ImageBitmap}))})}}}); | ||
//# sourceMappingURL=greenlet.umd.js.map |
@@ -19,4 +19,4 @@ /** Move an async function into its own thread. | ||
// Invoking within then() captures exceptions in the supplied async function as rejections | ||
Promise.resolve().then( | ||
$$.bind.apply($$, e.data) | ||
Promise.resolve(e.data[1]).then( | ||
v => $$.apply($$, v) | ||
).then( | ||
@@ -23,0 +23,0 @@ // success handler - callback(id, SUCCESS(0), result) |
{ | ||
"name": "greenlet", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Move an async function into its own thread.", | ||
@@ -5,0 +5,0 @@ "source": "greenlet.js", |
@@ -71,2 +71,7 @@ <p align="center"> | ||
### CSP | ||
If your app has a [Content-Security-Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy), | ||
Greenlet require `worker-src data:` and `script-src data:` in your config. | ||
## License & Credits | ||
@@ -73,0 +78,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
19184
81