erikjung
1/26/2016 - 12:53 AM

callDeep

callDeep

export function callDeep (path, obj, ...args) {
  var fn = path.split('.').reduce((prev, curr) => prev[curr], obj)
  return fn.apply(obj, args)
}