Skip to content

Commit

Permalink
Merge pull request #43 from puzzle-js/feature/refactor
Browse files Browse the repository at this point in the history
Feature/refactor
  • Loading branch information
Acanguven authored May 26, 2019
2 parents 8a7a4f3 + c255dcc commit bdfd498
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
29 changes: 28 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Warden is an outgoing request optimizer for creating fast and scalable applicati
- [Retry](#retry)
- [Holder](#holder)
- [Schema](#schema)
- [Debugger](#debugger)
- [Api](#api)

### Installing
Expand Down Expand Up @@ -307,6 +308,24 @@ Default values and properties
| logger || | Logger will be called on each retry with retry count|


### Debugger

Warden comes with built-in debugger to provide information about request flow.

To enable debug mode:
```js
warden.debug = true;
```

Flow will be visible on console.

Example log:
```
4323 | foo_44: HOLDER ---> CACHE
```

This means the request with the unique id 4323 and identifier value foo_44 is moving from Holder to Cache

### Api

#### warden.register()
Expand Down Expand Up @@ -358,7 +377,7 @@ warden.unregisterRoute('route');

#### warden.registerCachePlugin()

Unregisters route
Registers cache plugin
```js
warden.registerCachePlugin('pluginName', {
set(){
Expand All @@ -369,3 +388,11 @@ warden.registerCachePlugin('pluginName', {
}
});
```

#### warden.debug

Enables debug mode or disables based on boolean

```
warden.debug = true;
```
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "puzzle-warden",
"version": "1.6.0",
"version": "1.6.1",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"license": "MIT",
Expand Down

0 comments on commit bdfd498

Please sign in to comment.