redux-rungen
Advanced tools
Comparing version 0.1.1 to 0.2.0
@@ -36,5 +36,11 @@ 'use strict'; | ||
var runtimeReturningPromise = function runtimeReturningPromise(input) { | ||
return new Promise(function (resolve, reject) { | ||
return runtime(input, resolve, reject); | ||
}); | ||
}; | ||
return function (next) { | ||
return function (action) { | ||
return _is2.default.iterator(action) ? runtime(action) : next(action); | ||
return _is2.default.iterator(action) ? runtimeReturningPromise(action) : next(action); | ||
}; | ||
@@ -41,0 +47,0 @@ }; |
{ | ||
"name": "redux-rungen", | ||
"version": "0.1.1", | ||
"version": "0.2.0", | ||
"description": "Write your redux action creators as generators", | ||
@@ -18,6 +18,7 @@ "main": "dist/index.js", | ||
"redux": "^3.5.2", | ||
"rimraf": "^2.5.1" | ||
"rimraf": "^2.5.1", | ||
"rungen": "^0.3.0" | ||
}, | ||
"peerDependencies": { | ||
"rungen": "^0.2.0" | ||
"rungen": "^0.3.0" | ||
}, | ||
@@ -24,0 +25,0 @@ "scripts": { |
@@ -12,6 +12,11 @@ import is from './utils/is' | ||
]) | ||
const runtimeReturningPromise = input => | ||
new Promise((resolve, reject) => | ||
runtime(input, resolve, reject) | ||
) | ||
return next => action => | ||
is.iterator(action) ? | ||
runtime(action) : | ||
runtimeReturningPromise(action) : | ||
next(action) | ||
@@ -18,0 +23,0 @@ } |
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
10854
174
13