Skip to content

Commit 1ff7357

Browse files
author
jrtaylor
committed
docs(readme.md): more documentation
1 parent 1d0b26c commit 1ff7357

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

README.md

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
#### A simple plugin to help with timeouts.
33

44
[![codecov](https://codecov.io/gh/jrtnq514/vue-user-timeout/branch/master/graph/badge.svg)](https://codecov.io/gh/jrtnq514/vue-user-timeout)
5+
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
6+
[![npm version](https://badge.fury.io/js/vue-user-timeout.svg)](https://badge.fury.io/js/vue-user-timeout)
57

68
## Getting started
79
Install
@@ -12,16 +14,30 @@ Add plugin to your entry file
1214
```javascript
1315
import VueUserTimeout from 'vue-user-timeout'
1416

15-
Vue.use(VueUserTimeout, [options])
17+
Vue.use(VueUserTimeout, [[options](#options)])
1618
```
1719

1820
## Usage
1921

22+
Can be accessed through `this` or `Vue`
23+
```javascript
24+
this.$vueUserTimeout
25+
// or
26+
Vue.$vueUserTimeout
27+
```
28+
29+
## Example
30+
31+
Start the timeout after user authentication
32+
```javascript
33+
this.$vueUserTimeout.start();
34+
```
35+
2036

2137
## Methods
22-
**init()** - Initializes the user timeout using the default options. Also adds event listeners for resetting the timeout.
38+
**init()** - Initializes the user timeout using the default options. Also adds event listeners for resetting the timeout. *This is automatically called when the plugin is added, but can be called manually if the instance is ever destroyed.*
2339
```javascript
24-
this.$vueUserTimeout.init([options])
40+
this.$vueUserTimeout.init([[options](#options)])
2541
```
2642
**start()** - Starts the user timeout interval.
2743
```javascript

0 commit comments

Comments
 (0)