# we-lib **Repository Path**: mirrors_WebReflection/we-lib ## Basic Information - **Project Name**: we-lib - **Description**: wickedElements through customElements registry - **Primary Language**: Unknown - **License**: ISC - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-08-19 - **Last Updated**: 2025-12-20 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # we-lib A `customElements` indirection to have [wicked-elements](https://github.com/WebReflection/wicked-elements#readme) library a part, without needing to bundle it within components. ```js // vanilla customElements.whenDefined('we-lib').then(() => { const {define} = customElements.get('we-lib'); define('.my-component', { init() { console.log('my-component is ready'); } }); }); // with helper import when from 'once-defined'; when('we-lib').then(({define}) => { define('.another-component', { init() { console.log('another-component is ready'); } }); }); ``` ### Previous Work * [uce](https://github.com/WebReflection/uce#how-to-avoid-bundling-%C2%B5ce-per-each-component) provides this idea already * the idea has been described in [this blog post](https://medium.com/@WebReflection/some-web-components-hint-75dce339ac6b)