"use strict";
/*
 *  This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.
 *  License: AGPLv3 s.t. "Commons Clause" – see LICENSE.md for details
 */
Object.defineProperty(exports, "__esModule", { value: true });
var react_1 = require("react");
var router_1 = require("next/router");
function useCounter(id) {
    // call API to increment the counter
    var router = (0, router_1.useRouter)();
    (0, react_1.useEffect)(function () {
        if (id != null) {
            fetch("".concat(router.basePath, "/api/share/public_paths/counter/").concat(id));
        }
    }, [id]);
}
exports.default = useCounter;
//# sourceMappingURL=counter.js.map