# sync-mixin

> Emit events about sync

Latest version **1.0.2** (published 2015-11-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install sync-mixin
pnpm add sync-mixin
yarn add sync-mixin
bun add sync-mixin
```

## 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 | 2015-11-26 |
| First published | 2015-10-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.10 |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Kirill Fomichev |
| Maintainers | fanatid |
| Keywords | syncing, mixin |

## Links

- npm: https://www.npmjs.com/package/sync-mixin
- Repository: https://github.com/fanatid/sync-mixin
- Homepage: https://github.com/fanatid/sync-mixin#readme
- Issues: https://github.com/fanatid/sync-mixin/issues
- npm.io page: https://npm.io/package/sync-mixin

## Dependencies (1)

- [babel-runtime](https://npm.io/package/babel-runtime.md) ^5.8.25

## Recent versions

- 1.0.2 (latest) — 2015-11-26
- 1.0.1 — 2015-11-18
- 1.0.0 — 2015-10-24

## README

# sync-mixin

[![NPM Package](https://img.shields.io/npm/v/sync-mixin.svg?style=flat-square)](https://www.npmjs.org/package/sync-mixin)
[![Build Status](https://img.shields.io/travis/fanatid/sync-mixin.svg?branch=master&style=flat-square)](https://travis-ci.org/fanatid/sync-mixin)
[![Coverage Status](https://img.shields.io/coveralls/fanatid/sync-mixin.svg?style=flat-square)](https://coveralls.io/r/fanatid/sync-mixin)
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/feross/standard)
[![Dependency status](https://img.shields.io/david/fanatid/sync-mixin.svg?style=flat-square)](https://david-dm.org/fanatid/sync-mixin#info=dependencies)

## Installation

```
npm install sync-mixin
```

## API

### _getSyncCount()

**return**: `number`

### _setSyncCount()

  * `number` value

### _syncEnter()

### _syncExit()

### _withSync()

  * `function` fn

**return**: `Promise`

### _syncExitAll()

### isSyncing()

## Examples

###

```js
import { mixin } from 'core-decorators'
import SyncMixin from 'sync-mixin'

@mixin(SyncMixin)
class Process {
  run () {
    return this._withSync(() => {
      // some code that require time for execution
    })
  }
}

let process = new Process()
process.on('syncStart', () => console.log('Syncronization started!'))
process.on('syncStop', () => console.log('Syncronization finished!'))
setInterval(::process.run, 60 * 1000)
```

## License

This software is licensed under the MIT License.

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