Created
June 21, 2017 05:06
-
-
Save wdiasvargas/263def6259f5696b14210212c7a5fea4 to your computer and use it in GitHub Desktop.
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
/** | |
* Created in 20/06/2017. | |
* Author: William Dias Vargas | |
* Github: @wdiasvargas | |
*/ | |
"use strict"; | |
export default (fn, cache = {}) => (x) => (x in cache) ? cache[x] : cache[x] = fn(x); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment