# pulse-set

> Management for pulse and provide api to deal with it

Latest version **1.0.2** (published 2017-05-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install pulse-set
pnpm add pulse-set
yarn add pulse-set
bun add pulse-set
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2017-05-08 |
| First published | 2017-05-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Chen Yu |
| Maintainers | ycscholes |
| Keywords | pulse, setInterval, setTimeout |

## Links

- npm: https://www.npmjs.com/package/pulse-set
- Repository: https://github.com/ycscholes/pulse-set
- Homepage: https://github.com/ycscholes/pulse-set#readme
- Issues: https://github.com/ycscholes/pulse-set/issues
- npm.io page: https://npm.io/package/pulse-set

## Recent versions

- 1.0.2 (latest) — 2017-05-08

## README

# pulse-set
A singleton for pulse set (interval set)

## Why
* Easy to manage all the intervals in one place
* It's more convenient to manage all the interval cache by name than id
* Use setTimeout instead of setInterval so can stop the interval only return false in the action
* Enable to catch the exception

## Usage
```javascript
import PS from 'pulse-set.js';
PS.start('pulse', 1000, () => {
        console.log('Trigger an action');
    }, 
    () => {
        console.log('error');
    }
);

PS.end('pulse');
```

## API
`PS.start(name, time, action, error) - Start and cache a pulse`
* `name` {string}  Pulse name
* `time` {int}  Pulse timestamp
* `action` {function}  Pulse action
* `error` {function}  Emit when exception occures in action running

`PS.end(name) - End and remove the pulse`
* `name` {string}  Pulse name

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