(callback, initial)
| 34777 | */ parcelHelpers.export(exports, "useRefEffect", ()=>useRefEffect); |
| 34778 | var _react = require("react"); |
| 34779 | function useRefEffect(callback, initial) { |
| 34780 | if (initial === void 0) initial = null; |
| 34781 | var data = _react.useRef({ |
| 34782 | ref: Object.assign(function(value) { |
| 34783 | if (data.ref.current !== value) { |
| 34784 | if (data.cleanup) { |
| 34785 | data.cleanup(); |
| 34786 | data.cleanup = undefined; |
| 34787 | } |
| 34788 | data.ref.current = value; |
| 34789 | if (value !== null) data.cleanup = data.callback(value); |
| 34790 | } |
| 34791 | }, { |
| 34792 | current: initial |
| 34793 | }), |
| 34794 | callback: callback |
| 34795 | }).current; |
| 34796 | data.callback = callback; |
| 34797 | return data.ref; |
| 34798 | } |
| 34799 | |
| 34800 | },{"react":"8ePka","@parcel/transformer-js/src/esmodule-helpers.js":"jA2du"}],"jsoAX":[function(require,module,exports) { |
| 34801 | var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js"); |
nothing calls this directly
no outgoing calls
no test coverage detected