Skip to content

Commit

Permalink
unify handling with value & fetch request
Browse files Browse the repository at this point in the history
  • Loading branch information
Ville Saukkonen committed May 30, 2018
1 parent cce4a36 commit 41aa986
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/components/connect.js
Original file line number Diff line number Diff line change
Expand Up @@ -274,12 +274,7 @@ function connect(mapPropsToRequestsToProps, defaults, options) {
const onRejection = this.createPromiseStateOnRejection(prop, mapping, startedAt)

if (mapping.hasOwnProperty('value')) {
if (hasIn(mapping.value, 'then')) {
this.setAtomicState(prop, startedAt, mapping, initPS(meta))
return mapping.value.then(onFulfillment(meta), onRejection(meta))
} else {
return onFulfillment(meta)(mapping.value)
}
return onFulfillment(meta)(mapping.value)
} else {
const request = mapping.buildRequest(mapping)
meta.request = request
Expand Down

0 comments on commit 41aa986

Please sign in to comment.