redux-file-upload-header
Advanced tools
Comparing version 0.0.23 to 0.0.24
@@ -114,10 +114,8 @@ 'use strict'; | ||
function uploadFiles(identificator, url, files, type, data) { | ||
var concurrency = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 2; | ||
function uploadFiles(identificator, url, files, type, data, fileAPIOptions) { | ||
return function (params) { | ||
var dispatch = typeof params === 'function' ? params : params.dispatch; | ||
var uploadFilePromise = _promise2.default.map(files, function (file) { | ||
return uploadFile(dispatch, url, identificator, file, data); | ||
}, { concurrency: concurrency }); | ||
var allFilePromises = files.map(function (file) { | ||
return uploadFile(dispatch, url, identificator, file, data, fileAPIOptions); | ||
}); | ||
@@ -127,3 +125,3 @@ return { | ||
payload: { | ||
promise: uploadFilePromise | ||
promise: _promise2.default.all(allFilePromises) | ||
} | ||
@@ -130,0 +128,0 @@ }; |
{ | ||
"name": "redux-file-upload-header", | ||
"version": "0.0.23", | ||
"version": "0.0.24", | ||
"description": "Redux-friendly file upload made easy", | ||
@@ -66,7 +66,7 @@ "main": "lib/index.js", | ||
"peerDependencies": { | ||
"react": ">=15.5", | ||
"react-dom": ">=15.5", | ||
"react-redux": ">=5.0", | ||
"redux": ">=3.6" | ||
"react": ">=15.5.0", | ||
"react-dom": ">=15.5.0", | ||
"react-redux": ">=5.0.0", | ||
"redux": ">=3.6.0" | ||
} | ||
} |
@@ -81,10 +81,6 @@ import isServer from 'detect-node'; | ||
export function uploadFiles(identificator, url, files, type, data, concurrency = 2) { | ||
export function uploadFiles(identificator, url, files, type, data, fileAPIOptions) { | ||
return params => { | ||
const dispatch = typeof params === 'function' ? params : params.dispatch; | ||
const uploadFilePromise = Promise.map( | ||
files, | ||
file => uploadFile(dispatch, url, identificator, file, data), | ||
{ concurrency } | ||
); | ||
const allFilePromises = files.map(file => uploadFile(dispatch, url, identificator, file, data, fileAPIOptions)); | ||
@@ -94,3 +90,3 @@ return { | ||
payload: { | ||
promise: uploadFilePromise | ||
promise: Promise.all(allFilePromises) | ||
} | ||
@@ -97,0 +93,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
199495
974