Skip to content

Commit

Permalink
Use for loop in mergeAll
Browse files Browse the repository at this point in the history
  • Loading branch information
jxnblk committed May 4, 2019
1 parent f868fbf commit 6f5d329
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/index.js
Expand Up @@ -51,7 +51,13 @@ export const merge = (a, b) => {
return result
}

const mergeAll = (...args) => args.reduce((acc, arg) => merge(acc, arg), {})
const mergeAll = (...args) => {
let result = {}
for (let i = 0; i < args.length; i++) {
result = merge(result, args[i])
}
return result
}

export const style = ({
prop,
Expand Down

0 comments on commit 6f5d329

Please sign in to comment.