Skip to content

Commit

Permalink
smartAction errors are no longer cased to Errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian committed Dec 5, 2017
1 parent 61957c0 commit 91b138d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ I created this utility to allow you to get up and running with Redux in a fracti
* Easy *initialize* for parts of your store
* Easy install = works as the same as other redux middleware
* Pure JS no external dependencies!
* SuperSmall: under 3k (minify + gzip)

#### Have an existing project? No worries. Drop it in, to work along side the traditional redux way.

Expand Down
3 changes: 1 addition & 2 deletions middleware/smartActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ export default function (response){

response.json().then( jsonresult => {
if(jsonresult.errors){
const errors = jsonresult.errors.map(error=>new Error(error.message))
reject( errors.length === 1 ? errors[0] : errors )
reject( jsonresult.errors.length === 1 ? jsonresult.errors[0] : jsonresult.errors )
//reject( new Error(jsonresult.errors.map(error => error.message).join()))
} else {
if(1 === Object.keys(jsonresult).length && "object" === typeof jsonresult.data)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "redux-auto",
"version": "1.9.2",
"version": "1.9.3",
"description": "automatically generate stories and actions from your folder and file structure",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 91b138d

Please sign in to comment.