"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var react_1 = require("react");
// A *ref* that is true after component mounts, then false once
// the component unmounts.  This obviously must be a ref since
// it makes no sense for unmounting or mounting to trigger
// a render cycle!.  I made this up myself, but it does turn out
// to be identical to an npm package to do this:
//    https://github.com/jmlweb/isMounted/blob/master/index.js
function useIsMounted() {
    var is_mounted_ref = (0, react_1.useRef)(false);
    (0, react_1.useEffect)(function () {
        is_mounted_ref.current = true;
        return function () {
            is_mounted_ref.current = false;
        };
    }, []);
    return is_mounted_ref;
}
exports.default = useIsMounted;
//# sourceMappingURL=mounted.js.map