# event-spinner

> An event based spinner

Latest version **1.1.1** (published 2017-03-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install event-spinner
pnpm add event-spinner
yarn add event-spinner
bun add event-spinner
```

## 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.1.1 |
| Published | 2017-03-16 |
| First published | 2017-03-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Artiom Fotescu |
| Maintainers | h3yellex |
| Keywords | spinner, loader, loading, spin, component, javascript |

## Links

- npm: https://www.npmjs.com/package/event-spinner
- Repository: https://github.com/heyEllex/event-spinner
- Homepage: https://github.com/heyEllex/event-spinner#readme
- Issues: https://github.com/heyEllex/event-spinner/issues
- npm.io page: https://npm.io/package/event-spinner

## Recent versions

- 1.1.1 (latest) — 2017-03-16
- 1.1.0 — 2017-03-16
- 1.0.3 — 2017-03-15
- 1.0.2 — 2017-03-15
- 1.0.1 — 2017-03-15
- 1.0.0 — 2017-03-15

## README

##`event-spinner` 

`event-spinner` is a simple html element based on [FontAwesome](http://fontawesome.io/) icons which works with the help of EventEmitter

## Guide

##### 1. Installation

`npm install --save event-spinner`

##### 2. Add  [FontAwesome](http://fontawesome.io/) to your css
##### NOTE: This can be change at anytime
```
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
```
##### 3. Initialize event-spinner with options in your application

```javascript
import eventSpinner from 'event-spinner';

const config = {
    spinner: 'fa-spinner', // icon to spin
    animation: 'fa-spin', // animation type
    size: 'fa-3x', // icon size 
    fixed: true, // use fa-fw or no
    rgba: [255, 255, 255, 0.5], // rgba color
    container: 'app', // id of container where spinner should be used
    z: 8000, // z-index
    top: 50, // position from top
    left: 50, // position from left
};
export const spinner = new eventSpinner(config);
```

##### 4. Import your initialized spinner and use 

```javascript
import { spinner }  from './initializedSpinner';

const getSomeData = () => {
    spinner.showSpinner();
    fetch('someurl')
        .then((res) => {
            spinner.hideSpinner();
            // process results
        })
        .catch((err) => {
            spinner.hideSpinner();
            // do smth with error
        })
};

```

default props: In case you don't pass the props

```
spinner: 'fa-spinner'
animation: 'fa-spin'
size: 'fa-3x' 
fixed: true
rgba: [255, 255, 255, 0.5]
container: 'app'
z: 8000
top: 50
left: 50
```

# Example

You can checkout the demo in example folder by downloading and running demo.html in your browser

# TODO
create test.

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