# @qiov/beacon-main-core

> beacon Main Core

Latest version **0.1.4** (published 2022-02-08) · 0 weekly downloads

## Install

```sh
npm install @qiov/beacon-main-core
pnpm add @qiov/beacon-main-core
yarn add @qiov/beacon-main-core
bun add @qiov/beacon-main-core
```

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.4 |
| Published | 2022-02-08 |
| First published | 2022-02-08 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 26.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | aslinwang |
| Keywords | beacon-core |

## Links

- npm: https://www.npmjs.com/package/@qiov/beacon-main-core
- Repository: https://git.code.oa.com/beacon/beacon_sdk_js
- npm.io page: https://npm.io/package/@qiov/beacon-main-core

## Recent versions

- 0.1.4 (latest) — 2022-02-08

## README

# 灯塔上报核心

核心类 Core 更多的是提供一个用户设置, 数据管理系统.

Core 中实现了一个队列. 当用户有需要上报的数据时, 会直接入队列. 再由 Core 决定何时去上报.

## 为什么要实现一个队列而不是直接的发起请求?

为了解耦用户的数据采集和数据上报两个动作. 用户可能触发了数据的采集, 但是数据的上报可以合并上报. 对于不敏感的数据. 可以使用采点上报, 比如(平均时长等). 再者. 数据上所依赖于端的能力, 像: web 的 ajax, sendBeacon, websocket, hippy 的 fetch 等. 所以数据请求层可以转架到专有的场景去实现.

## eventHub. 事件总线.

Core 为在以下的阶段发送事件.

| 阶段               | 事件名    | 参数 |
| ------------------ | --------- | ---- |
| 初始化时           | init      |      |
| 新的上报作业添加时 | jobAppend |      |

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