Last active
January 26, 2016 01:01
-
-
Save erikjung/f1a17a3bc6b828abb9ad to your computer and use it in GitHub Desktop.
callDeep
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function callDeep (path, obj, ...args) { | |
var fn = path.split('.').reduce((prev, curr) => prev[curr], obj) | |
return fn.apply(obj, args) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment