Created
July 11, 2018 12:04
-
-
Save artisonian/2de0c5876955d4d497d0e7b94e43015e to your computer and use it in GitHub Desktop.
This file contains hidden or 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 default function trampoline (fn) { | |
| return (...args) => { | |
| let result = fn(...args); | |
| while (result instanceof Function) { | |
| result = result(); | |
| } | |
| return result; | |
| }; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment