"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 });
const react_1 = require("react");
const router_1 = require("next/router");
function useCounter(id) {
    // call API to increment the counter
    const router = (0, router_1.useRouter)();
    (0, react_1.useEffect)(() => {
        if (id != null) {
            fetch(`${router.basePath}/api/share/public_paths/counter/${id}`);
        }
    }, [id]);
}
exports.default = useCounter;
//# sourceMappingURL=counter.js.map