Skip to content

Commit 16d495a

Browse files
committed
Document 'debounceDelay' option and cleanup documentation
1 parent e4c1ee9 commit 16d495a

File tree

1 file changed

+19
-22
lines changed

1 file changed

+19
-22
lines changed

README.MD

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -17,27 +17,23 @@ $ npm install ng-http-loader --save
1717
## What does it do ?
1818

1919
This package provides an HTTP Interceptor, and a spinner component (All from [SpinKit](https://github.com/tobiasahlin/SpinKit) at the moment).
20-
The HTTP interceptor listens to all HTTP requests and shows a spinner during pending requests.
20+
The HTTP interceptor listens to all HTTP requests and shows a spinner / loader indicator during pending http requests.
2121

2222
## Angular 4 / Angular 5
2323

24-
The latest compatible module version with angular 4 is **``0.3.4``**.
25-
If you want to use Angular 5, use **``^0.5.0``**.
24+
The latest module version compatible with angular 4 is **``0.3.4``**.
25+
If you want to use Angular 5, use versions **``0.4.0``** and above.
2626

2727
If you experience errors like below, **please double check the version you use.**
2828

2929
``ERROR in Error: Metadata version mismatch for module [...]/angular/node_modules/ng-http-loader/ng-http-loader
30-
.module.d.ts, found version 4, expected 3, resolving symbol AppModule in [...]/angular/src/app.module.ts``
31-
30+
.module.d.ts, found version x, expected y, resolving symbol AppModule in [...]/angular/src/app.module.ts``
3231

33-
## Requirements
32+
## Requirements - HttpClientModule
3433

35-
Compatible with Angular 4.3+. Performing http requests with the new API from ``HttpClientModule`` is **mandatory**. Otherwise,
36-
the spinner will not be fired **at all**.
34+
Performing http requests with the ``HttpClientModule`` API is **mandatory**. Otherwise,the spinner will not be fired **at all**.
3735

38-
## HttpClientModule
39-
40-
All http requests **MUST** be performed with the new ``HttpClientModule`` available from ``angular 4.3``. See this [blog post](http://blog.ninja-squad.com/2017/07/17/http-client-module/) as reference.
36+
See this [blog post](http://blog.ninja-squad.com/2017/07/17/http-client-module/) for an ``HttpClientModule`` introduction.
4137

4238
## Usage
4339

@@ -93,19 +89,24 @@ import { NgHttpLoaderServicesModule } from 'ng-http-loader/services/ng-http-load
9389
export class AppModule { }
9490
```
9591

96-
In your app.component.html, add :
92+
In your app.component.html, simply add :
9793
```xml
9894
<spinner></spinner>
9995
```
10096

10197
## Customizing the spinner
10298

103-
You can customize the background-color and the spinner type:
99+
You can customize the **background-color**, the **spinner type** and the **debounce delay** (ie. after how many milliseconds the spinner will be displayed, if needed):
104100
```xml
105-
<spinner [backgroundColor]="'#ff0000'" [spinner]="spinkit.skWave"></spinner>
101+
<spinner
102+
[backgroundColor]="'#ff0000'"
103+
[spinner]="spinkit.skWave"
104+
[debounceDelay]="200"
105+
>
106+
</spinner>
106107
```
107108

108-
**_To use this syntax, you must reference the ``Spinkit`` const as a public property in you app.component.ts_**:
109+
**_To use this syntax, you must reference the ``Spinkit`` const as a public property in your app.component.ts_**:
109110

110111
```typescript
111112
import { Spinkit } from 'ng-http-loader/spinkits'; <============
@@ -131,13 +132,9 @@ The different spinners available are referenced in [this class](src/spinkits.ts)
131132

132133
## Requests filtering
133134

134-
You can filter the requests that shouldn't be caught by the interceptor by providing **an array of regex patterns**:
135+
You can also filter the http requests that shouldn't be caught by the interceptor by providing **an array of regex patterns**:
135136
```xml
136-
<spinner
137-
[backgroundColor]="'#ff0000'"
138-
[spinner]="spinkit.skWave"
139-
[filteredUrlPatterns]="['\\d', '[a-zA-Z]', 'my-api']">
140-
</spinner>
137+
<spinner [filteredUrlPatterns]="['\\d', '[a-zA-Z]', 'my-api']"></spinner>
141138
```
142139

143140
## Misc
@@ -146,4 +143,4 @@ Each Spinkit component defined in [SPINKIT_COMPONENTS](src/spinkits.ts#L30) can
146143

147144
## Credits
148145

149-
The spinners/loaders have been taken from [SpinKit](https://github.com/tobiasahlin/SpinKit).
146+
[Tobias Ahlin](https://github.com/tobiasahlin), the awesome creator of [SpinKit](https://github.com/tobiasahlin/SpinKit).

0 commit comments

Comments
 (0)