Skip to content

Commit

Permalink
Merge pull request #243 from hyperapp/feat/actions-return-sub-state
Browse files Browse the repository at this point in the history
Return the state fragment to the caller if the action is a reducer.
  • Loading branch information
zaceno authored and jorgebucaran committed Jun 23, 2017
2 parents 76af871 + 4e21e24 commit 04c84d4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ export default function(app) {
emit
)

if (result == null || typeof result.then === "function") {
return result
if (result != null && typeof result.then !== "function") {
render((state = merge(state, emit("update", result))), view)
}

render((state = merge(state, emit("update", result))), view)
return result
}
} else {
init(namespace[key] || (namespace[key] = {}), action, name)
Expand Down

0 comments on commit 04c84d4

Please sign in to comment.