Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/MeForma/vue-wait-for
A loader manager for vue3 with reactive method
https://github.com/MeForma/vue-wait-for
loader manager vue-3 vue-js vuejs vuejs3 wait waiting waiting-ti
Last synced: 2 months ago
JSON representation
A loader manager for vue3 with reactive method
- Host: GitHub
- URL: https://github.com/MeForma/vue-wait-for
- Owner: MeForma
- License: mit
- Created: 2021-01-13T12:50:46.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-01-13T14:00:53.000Z (over 3 years ago)
- Last Synced: 2024-03-23T14:45:08.566Z (3 months ago)
- Topics: loader, manager, vue-3, vue-js, vuejs, vuejs3, wait, waiting, waiting-ti
- Language: JavaScript
- Homepage:
- Size: 2.93 KB
- Stars: 12
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Lists
- awesome-vue - vue-wait-for - A loader manager for Vue.js 3 with reactive method (Components & Libraries / UI Components)
- awesome-vue - vue-wait-for - A loader manager for Vue.js 3 with reactive method (Components & Libraries / UI Components)
- awesome-vue - vue-wait-for - A loader manager for Vue.js 3 with reactive method (Components & Libraries / UI Components)
- awesome-vue - vue-wait-for - A loader manager for Vue.js 3 with reactive method (Components & Libraries / UI Components)
- awesome-vue - vue-wait-for - A loader manager for Vue.js 3 with reactive method (Components & Libraries / UI Components)
- awesome-vue - vue-wait-for - A loader manager for Vue.js 3 with reactive method (Components & Libraries / UI Components)
- awesome-vue - vue-wait-for - A loader manager for vue3 with reactive method (UI Components [🔝](#readme))
- awesome-vue - vue-wait-for - A loader manager for Vue.js 3 with reactive method (Components & Libraries / UI Components)
README
# Vue Wait For
A loader manager for vuejs 3 with reactive method
## Installation
```bash
# yarn
yarn add @meforma/vue-wait-for# npm
npm install @meforma/vue-wait-for
```## Import
```js
// In you main.js
// ... considering that your app creation is here
import wait from "@meforma/vue-wait-for";createApp(App).use(wait).mount("#app");
```## Usage
```html
Waiting Dogs Time...
Dogs are ready!!
export default {
name: "dogs",
mounted() {
this.$wait.start("waiting-dogs-time");
let timeoute = setTimeout(() => {
console.log(
"time in milliseconds:",
this.$wait.end("waiting-dogs-time"),
);clearTimeout(timeoute);
timeoute = null;
}, 5000);
},
};```
## Methods
### start(name)
Starts the wait for some word (string). You can't start the same wait more than one time, before execute end.
```js
this.$wait.start("something");
```### end(name)
Kills the wait for some word (string), and returns the duration time of the wait in milliseconds.
```js
this.$wait.end("something");
```### is(name)
Checks if exists a wait for some word (string).
```js
this.$wait.is("something");
```### any()
Checks if exists any wait.
```js
this.$wait.any();
```### clear()
Kills all waits, and returns a object with the duration time of all waits in milliseconds.
```js
this.$wait.clear();
```## License
[MIT](LICENSE.txt) License