Skip to content

Commit

Permalink
somewhat more robust code
Browse files Browse the repository at this point in the history
  • Loading branch information
okwolf committed Jan 22, 2018
1 parent c05f971 commit 63596fa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cra-hyperapp",
"version": "0.0.3",
"version": "0.0.4",
"description": "Hyperapp expansion pack for create-react-app",
"main": "src/index.js",
"bin": {
Expand Down
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const h = (type, props, ...children) =>
type,
typeof type === "function" && type.length === 1
? { ...props, children }
: Object.keys(props).reduce(
: Object.keys(props || {}).reduce(
(otherProps, name) => ({
...otherProps,
[propRename(name)]: props[name]
Expand Down Expand Up @@ -53,7 +53,7 @@ export const connect = (mapStateToProps, mapDispatchToProps) => Component => (
{
...props,
...mapStateToProps(secretInternals.store.getState(), props),
...Object.keys(mapDispatchToProps).reduce(
...Object.keys(mapDispatchToProps || {}).reduce(
(otherActions, name) => ({
...otherActions,
[name]: data =>
Expand Down

0 comments on commit 63596fa

Please sign in to comment.