diff --git a/docs/http-module.md b/docs/http-module.md index 8c260f4..6e578f3 100644 --- a/docs/http-module.md +++ b/docs/http-module.md @@ -1,9 +1,11 @@ # Router Module ## Automatically Block HTTP Requests + This module allows for blocking automatically during all HTTP requests made with the `HttpClient` ### Setup + The core `BlockUIModule` should first be imported within the app. Once added, a seperate module called `BlockUIHttpModule` should then be imported to allow for HTTP blocking. ```ts @@ -23,9 +25,11 @@ export class AppModule {} ``` ### Setting: `requestFilters` + Accepts an array of requests to be filtered out from being blocked. **Types** + ``` requestFilters: (RegExp | { method: string, url: RegExp } | Function)[] ``` @@ -33,6 +37,7 @@ requestFilters: (RegExp | { method: string, url: RegExp } | Function)[] _Note: If using RegExp with AOT compiling, please see this [Stack Overflow Post](https://stackoverflow.com/questions/48751006/ng-build-gives-an-error-because-of-regexp)._ #### Type: `RegExp` + Filter requests by URL Below will filter out blocking for any requests containing `api.github.com/users/` in the URL. @@ -51,6 +56,7 @@ export class AppModule {} ``` #### Type: `{ method: string, url: RegExp }` + Filter requests by http method and URL Below will filter out blocking for any requests with a `POST` method and a URL containing `api.github.com/users/` @@ -72,6 +78,7 @@ export class AppModule {} ``` #### Type: `Function` + Filter requests by passing a function. The function will be passed the current request and if `true` is returned the request will not be blocked. Below will filter out all requests with a query parameter of `foo=bar`. @@ -94,8 +101,9 @@ export class AppModule {} ``` ### Setting: `blockAllRequestsInProgress` -Accepts a boolean. If set to `true`, it deactivates the BlockUI only once the last httpRequest has been processed in case of parallel requests. -Defaulted to `false`. +If set to `false`, when multiple http requests are fired off blocking will stop when the first request resolves instead of waiting for all requests to resolve. + +Defaulted to `true`. -#### Type: `boolean` \ No newline at end of file +#### Type: `boolean`