@symbolic/react-app
Advanced tools
Comparing version 1.3.19 to 1.3.20
{ | ||
"name": "@symbolic/react-app", | ||
"version": "1.3.19", | ||
"version": "1.3.20", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -9,3 +9,3 @@ import _ from 'lodash'; | ||
type: `${superType}.${subType}`, | ||
isAsync: getPayload.constructor.name === (async function () {}).constructor || getPayload.then | ||
isAsync: getPayload.constructor === (async function () {}).constructor | ||
}; | ||
@@ -20,12 +20,14 @@ }); | ||
var _getPayload = () => getPayload({getState, prevState, [superType]: prevState, ...props}); | ||
console.log(type, isAsync, getPayload); | ||
if (isAsync) { | ||
var _getPayload = async () => await getPayload({getState, prevState, [superType]: prevState, ...props}); | ||
dispatch({type: `${type}.begin`, payload: {...prevState, isLoading: true}}); | ||
console.log('begin'); | ||
_getPayload().then(payload => { | ||
console.log('success'); | ||
try { | ||
var payload = await _getPayload(); | ||
dispatch({type: `${type}.success`, payload: {isLoading: false, ...payload}}); | ||
}) | ||
.catch(error => { | ||
} | ||
catch (error) { | ||
console.error(error); //eslint-disable-line | ||
@@ -36,5 +38,7 @@ | ||
throw error; | ||
}); | ||
} | ||
} | ||
else { | ||
var _getPayload = () => getPayload({getState, prevState, [superType]: prevState, ...props}); | ||
dispatch({type, payload: _getPayload()}); | ||
@@ -41,0 +45,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
21358
541