leaflet-components/src/core
Buddy e2752aa7e0 refactor: extract child-registration boilerplate into WeakMap helpers
Adds registerChildren / unregisterChildren / getChildren to
register.ts using module-scoped WeakMaps, removing the duplicated
#children / #childHandler fields + lifecycle wiring from 15
components.

registerChildren(el, layer) creates the children Map + handler,
stores both in WeakMaps, wires the event listener, and calls
registerWithParent — all in one call. unregisterChildren(el)
tears it down. getChildren(el) gives access to the map for
components that need custom child iteration in disconnectedCallback
(geojson, layer-group, feature-group).

Net: -101 lines, 15 components lose 2-4 fields + 4-8 lifecycle
lines each. Components with extra lifecycle work (marker -> dragend,
polygon/polyline -> observer + syncCoords) keep their custom
additions inline, just the register boilerplate is replaced.
2026-06-08 22:45:08 -07:00
..
path-style.ts refactor: replace inheritance hierarchy with composable PROPS-table pattern 2026-06-06 14:10:49 -07:00
register.ts refactor: extract child-registration boilerplate into WeakMap helpers 2026-06-08 22:45:08 -07:00
utils.ts refactor: extract duplicate #num helper into standalone numAttr() 2026-06-08 22:32:25 -07:00
with-props.ts refactor: extract withProps mixin to eliminate TypedBase/observedAttributes boilerplate 2026-06-08 22:09:16 -07:00