UNPKG

@benev/nubs

Version:
15 lines (10 loc) 299 B
import {NubContext} from "../../context/element.js" export function stateForClosestContext(element: HTMLElement) { return () => { const context = element .closest<NubContext>("nub-context") if (!context) throw new Error("parental nub-context element not found") return context } }