# vue-busy-state-mixin

> Indicates that a component is busy until some work is done

Latest version **1.1.3** (published 2024-04-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install vue-busy-state-mixin
pnpm add vue-busy-state-mixin
yarn add vue-busy-state-mixin
bun add vue-busy-state-mixin
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.3 |
| Published | 2024-04-25 |
| First published | 2018-09-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Ralph Pillichshammer |
| Maintainers | rlink, badmike |
| Keywords | vue.js, busy, state, loading |

## Links

- npm: https://www.npmjs.com/package/vue-busy-state-mixin
- Repository: https://github.com/neonblack-at/vue-busy-state-mixin
- Homepage: https://github.com/neonblack-at/vue-busy-state-mixin#readme
- Issues: https://github.com/neonblack-at/vue-busy-state-mixin/issues
- npm.io page: https://npm.io/package/vue-busy-state-mixin

## Alternatives

- [@reckona/mreact-store](https://npm.io/package/@reckona/mreact-store.md) — 976 weekly downloads
- [regular-state](https://npm.io/package/regular-state.md) — 410 weekly downloads
- [@pacote/flux-actions](https://npm.io/package/@pacote/flux-actions.md) — 65 weekly downloads
- [@pilotlab/lux-debug](https://npm.io/package/@pilotlab/lux-debug.md) — 39 weekly downloads
- [vue-persist-state](https://npm.io/package/vue-persist-state.md) — 19 weekly downloads

## Recent versions

- 1.1.3 (latest) — 2024-04-25
- 1.1.2 — 2024-04-25
- 1.1.1 — 2018-10-05
- 1.1.0 — 2018-10-05
- 1.0.2 — 2018-09-26
- 1.0.1 — 2018-09-18
- 1.0.0 — 2018-09-13

## README

# vue-busy-state-mixin

This is a simple mixin which should help implementing some king of loading state while a component is doing someting. The implementation is based on Promises. So the example below on how it works.

## Installation

```bash
yarn add vue-busy-state-mixin
```

## Example

```html
<template>
  <div>
    <template v-if="isBusy">I'm working!</template> 
  </div>
</template>

<script>
  import busyState from 'vue-busy-state-mixin'

  export default {
    name: 'App',
    mixins: [busyState],
    mounted() {
      this.do(this.work)
        .then(() => {
          // work is done
        })
        .catch(() => {
          // something went wrong while working
        })
    },
    methods: {
      work() {
        return new Promise((resolve) => {
          setTimeout(() => {
              resolve()            
          }, 1000)
        })
      }
    }
  }
</script>
```

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