# track-action

> this is an event track request encapsulation

Latest version **1.5.0** (published 2020-11-19) · ISC license · 0 weekly downloads

## Install

```sh
npm install track-action
pnpm add track-action
yarn add track-action
bun add track-action
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score; declining downloads.

## Facts

| | |
|---|---|
| Version | 1.5.0 |
| Published | 2020-11-19 |
| First published | 2020-11-18 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | lnden |
| Maintainers | lnden |
| Keywords | event, track |

## Links

- npm: https://www.npmjs.com/package/track-action
- npm.io page: https://npm.io/package/track-action

## Alternatives

- [async-exit-hook](https://npm.io/package/async-exit-hook.md) — 3.7M weekly downloads
- [evnty](https://npm.io/package/evnty.md) — 7.2K weekly downloads
- [eleventy-plugin-asciidoc](https://npm.io/package/eleventy-plugin-asciidoc.md) — 3.5K weekly downloads
- [@jswork/next-get2get](https://npm.io/package/@jswork/next-get2get.md) — 945 weekly downloads
- [@dashersw/axon](https://npm.io/package/@dashersw/axon.md) — 934 weekly downloads

## Recent versions

- 1.5.0 (latest) — 2020-11-19
- 1.4.0 — 2020-11-18
- 1.3.0 — 2020-11-18
- 1.2.0 — 2020-11-18

## README

# track-action

&emsp;&emsp; Event-track is a global event trace with XMLHttpRequest requests built in

# track-action Using Process

## Installation

```
npm install track-action -S
```

## Use

```
import GlobalAction from "track-action";
const E = new GlobalAction({
    url: 'http://xxx:8080/send/request',
    data: {
        userId: 1,
    },
    headers: {}
});

Vue.prototype.$eventTrack = E.trackAction.bind(E);
React.$eventTrack = E.trackAction.bind(E);
```

## Vue Event

```
this.$eventTrack({
    userId: 2,
});

```

## React Event

```
React.$eventTrack({
    userId: 2,
});
```

## Note

data 参数采用合并策略，调用事件传递参数会覆盖初始化参数，可以在初始化增加通用参数，事件调用增加专用参数

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