UNPKG

@agnos-ui/core

Version:

Framework-agnostic headless component library.

16 lines (15 loc) 500 B
"use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); const tansu = require("@amadeus-it-group/tansu"); const hash$ = tansu.readable("", { onUse({ set }) { function handleHashChange() { const hash = location.hash; set(hash ? hash.substring(1) : ""); } handleHashChange(); window.addEventListener("hashchange", handleHashChange); return () => window.removeEventListener("hashchange", handleHashChange); } }); exports.hash$ = hash$;