@mopinion/survey
Version:
Collect customer feedback with the Mopinion survey library
21 lines (20 loc) • 540 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _hooks = require("preact/hooks");
function useIsMounted() {
var isMounted = (0, _hooks.useRef)(false);
(0, _hooks.useEffect)(function () {
isMounted.current = true;
return function () {
isMounted.current = false;
};
}, []);
return (0, _hooks.useCallback)(function () {
return isMounted.current;
}, []);
}
var _default = exports["default"] = useIsMounted;
//# sourceMappingURL=useIsMounted.js.map