npm install --save @playframe/evolve
import evolve from '@playframe/evolve'
const props = {onclick: (event)=> fetch()}
const clickLogger = { onclick: (handler)=>(e)=>
console.log(e)
handler && handler(e);
}
const loggedClicksProps = evolve(props, clickLogger);
Caching Array.isArray
for perf
{isArray} = Array
Exporting a deep assign that passes old values to functions
module.exports = evolve = (base, upgrade)=>
evolved = {base...}
for k, v of upgrade
type = typeof v
evolved[k] = if type is 'function'
v base[k]
else if type is 'object' and not isArray v
evolve base[k], v
else
v
evolved