(fn)
| 1 | export default function onlyOnce(fn) { |
| 2 | return function() { |
| 3 | if (fn === null) throw new Error("Callback was already called."); |
| 4 | var callFn = fn; |
| 5 | fn = null; |
| 6 | callFn.apply(this, arguments); |
| 7 | }; |
| 8 | } |
no outgoing calls
no test coverage detected
searching dependent graphs…