# dync_expose

> dynamic expose for Web. mobile, support 'IntersectionObserver' and 'Scroll'

Latest version **0.0.4** (published 2022-10-09) · ISC license · 0 weekly downloads

## Install

```sh
npm install dync_expose
pnpm add dync_expose
yarn add dync_expose
bun add dync_expose
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.4 |
| Published | 2022-10-09 |
| First published | 2022-10-08 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 12.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | shiningding |
| Maintainers | shiningding |

## Links

- npm: https://www.npmjs.com/package/dync_expose
- Repository: https://github.com/dxdnsicon/dyncExpose
- Homepage: https://github.com/dxdnsicon/dyncExpose#readme
- Issues: https://github.com/dxdnsicon/dyncExpose/issues
- npm.io page: https://npm.io/package/dync_expose

## Recent versions

- 0.0.4 (latest) — 2022-10-09
- 0.0.3 — 2022-10-09
- 0.0.2 — 2022-10-08
- 0.0.1 — 2022-10-08

## README

# dynamic expose module:
监控DOM元素是否曝光在可视区,  基于window.IntersectionObserver 实现，摒弃scroll的方式，理论上性能会好一些。不用绑定很多的滚动监听，在不支持的环境里会降级成scroll，使用者不用担心兼容性问题
### example:
```
import dyncExpose from 'dync_expose';
const exposeId = 'my_dom_isRepeat';  // If the id contains 'isRepeat', repeated exposure after the callback will still trigger the callback;

dyncExpose({
  id: exposeId, // id it means your dom's id,  and Id is the only one on this page;
  parent: null,  // null, it means document.body;
  cb() {
    // If the element is exposed, the callback function will be triggered
  },
});

<div id="my_dom_isRepeat">xxx</div>
```

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