# he-lib

> hookedElements through customElements registry

Latest version **0.1.1** (published 2020-07-30) · ISC license · 0 weekly downloads

## Install

```sh
npm install he-lib
pnpm add he-lib
yarn add he-lib
bun add he-lib
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2020-07-30 |
| First published | 2020-07-30 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 28.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Andrea Giammarchi |
| Maintainers | webreflection |
| Keywords | wicked, elements, custom |

## Links

- npm: https://www.npmjs.com/package/he-lib
- Repository: https://github.com/WebReflection/we-lib
- Homepage: https://github.com/WebReflection/we-lib#readme
- Issues: https://github.com/WebReflection/we-lib/issues
- npm.io page: https://npm.io/package/he-lib

## Dependencies (1)

- [hooked-elements](https://npm.io/package/hooked-elements.md) ^2.0.0

## Recent versions

- 0.1.1 (latest) — 2020-07-30
- 0.1.0 — 2020-07-30
- 0.0.0 — 2020-07-30

## README

# he-lib

A `customElements` indirection to have [hooked-elements](https://github.com/WebReflection/hooked-elements#readme) library a part, without needing to bundle it within components.

```js
// vanilla
customElements.whenDefined('he-lib').then(() => {
  const {define} = customElements.get('he-lib');
  define('.my-component', {
    init() {
      console.log('my-component is ready');
    }
  });
});

// with helper
import when from 'once-defined';
when('he-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)

---
_Source: https://npm.io/package/he-lib · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
