# six-auto-refresh

> A component that provides auto-refresh support to widgets

Latest version **1.0.5** (published 2017-09-08) · 0 weekly downloads

## Install

```sh
npm install six-auto-refresh
pnpm add six-auto-refresh
yarn add six-auto-refresh
bun add six-auto-refresh
```

## 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.5 |
| Published | 2017-09-08 |
| First published | 2016-06-16 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | six-cd, wallrat |

## Links

- npm: https://www.npmjs.com/package/six-auto-refresh
- npm.io page: https://npm.io/package/six-auto-refresh

## Dependencies (1)

- [six-sdk](https://npm.io/package/six-sdk.md) ^1.0.8

## Recent versions

- 1.0.5 (latest) — 2017-09-08
- 1.0.4 — 2017-09-04
- 1.0.3 — 2017-09-04
- 1.0.2 — 2017-08-02
- 1.0.1 — 2017-04-12
- 1.0.0 — 2016-09-15
- 0.1.3 — 2016-08-31
- 0.1.2 — 2016-08-16
- 0.1.1 — 2016-07-08
- 0.1.0 — 2016-06-16

## README

# AutoRefresh component


## Usage

### NPM
```bash
# npm install six-auto-refresh
```

```javascript
import AutoRefresh from 'six-auto-refresh'

// initialize with a session from SDK
let manager = AutoRefresh(session,
  {
    // refresh data every 10s
    interval: 10,
    // stop auto-refresh after 10min
    timeout: 10*60,
    // stop auto-refresh after 3min non-activity
    idleTimeout: 3*60,
    // callback that should return true when auto-refresh is enabled
    enabled: function() { return true },
    // callback called when auto-refresh is enabled/disabled
    onStateChange: function (isEnabled) { return }
})

// pause auto-refresh
manager.stop()

// restart auto-refresh after pause or timeout
manager.restart()

```

### CDN

```html
<script type="text/javascript" src="https://cdn.six.se/js/six-auto-refresh/0/six-auto-refresh.min.js" />

```

```javascript
// initialize with session from SDK
Six.Components.AutoRefresh(session,
  {
    // refresh data every 10s
    interval: 10,
    // stop auto-refresh after 10min
    timeout: 10*60,
    // stop auto-refresh after 3min non-activity
    idleTimeout: 3*60,
    // callback that should return true when auto-refresh is enabled
    enabled: function() { return true },
    // callback called when auto-refresh is enabled/disabled
    onStateChange: function (isEnabled) { return }  
  })

```

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