one
Version:
One is a new React Framework that makes Vite serve both native and web.
20 lines (19 loc) • 668 B
JavaScript
import { getPathFromState } from "../fork/getPathFromState.mjs";
import { getStateFromPath } from "../fork/getStateFromPath.mjs";
function getInitialURL() {
return typeof window > "u" ? "" : window.location?.href || "";
}
function getRootURL() {
return "/";
}
function addEventListener(listener) {
if (typeof window > "u") return () => {};
const callback = () => {
listener(window.location.href);
};
return window.addEventListener("popstate", callback), () => {
window.removeEventListener("popstate", callback);
};
}
export { addEventListener, getInitialURL, getPathFromState, getRootURL, getStateFromPath };
//# sourceMappingURL=linking.mjs.map