funes
Remember everything, for better or for worse
Funes is a variadic memoizer: every time a function is called via funes, its output is cached. The next time the same expression is executed, funes returns the cached results instead of executing the function again.
It is a 'floating method', and operates on the function passed as this
- which plays nicely with ES7's bind operator (::
).
In ES7
const add = { console return a + b} // => 'Adding!'// => 3 // => 'Adding!'// => 3 add::// => 'Adding!'// => 3 add::// => 3
In an ES3+ browser