Skip to content

Commit b7214f8

Browse files
committed
fixed example
1 parent 08f163e commit b7214f8

File tree

8 files changed

+11
-11
lines changed

8 files changed

+11
-11
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ Now we apply the log function as a middleware to a Person instance.
7373
// apply middleware to target object
7474
const p = new Person();
7575
const middlewareManager = new MiddlewareManager(p);
76-
middlewareManager.use('walk', walk);
76+
middlewareManager.use('walk', logger);
7777
p.walk(3);
7878
```
7979
Whenever a Person instance call it's walk method, we'll see logs from the looger middleware.

dist/middleware.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/html/MiddlewareManager.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ <h5>Example</h5>
222222
// apply middleware to target object
223223
const p = new Person();
224224
const middlewareManager = new MiddlewareManager(p);
225-
middlewareManager.use(&#x27;walk&#x27;, walk);
225+
middlewareManager.use(&#x27;walk&#x27;, logger);
226226
p.walk(3);
227227

228228
Whenever a Person instance call it&#x27;s walk method, we&#x27;ll see logs from the looger middleware.
@@ -1006,7 +1006,7 @@ <h4 class="modal-title">Search results</h4>
10061006
<span class="jsdoc-message">
10071007
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a>
10081008

1009-
on 2017-05-27
1009+
on 2017-06-21
10101010

10111011
using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
10121012
</span>

docs/html/classes.list.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ <h4 class="modal-title">Search results</h4>
205205
<span class="jsdoc-message">
206206
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a>
207207

208-
on 2017-05-27
208+
on 2017-06-21
209209

210210
using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
211211
</span>

docs/html/global.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ <h4 class="modal-title">Search results</h4>
367367
<span class="jsdoc-message">
368368
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a>
369369

370-
on 2017-05-27
370+
on 2017-06-21
371371

372372
using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
373373
</span>

docs/html/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ <h1>Usages</h1><h2>Basic</h2><p>We define a Person class.</p>
141141
<pre class="prettyprint source"><code> // apply middleware to target object
142142
const p = new Person();
143143
const middlewareManager = new MiddlewareManager(p);
144-
middlewareManager.use('walk', walk);
144+
middlewareManager.use('walk', logger);
145145
p.walk(3);</code></pre><p>Whenever a Person instance call it's walk method, we'll see logs from the looger middleware.</p>
146146
<h2>Middleware object</h2><p>We can also apply a middleware object to a target object. Middleware object is an object that contains function's name as same as the target object's function name.
147147
Function's name start or end with &quot;_&quot; will not be able to apply middleware.</p>
@@ -284,7 +284,7 @@ <h4 class="modal-title">Search results</h4>
284284
<span class="jsdoc-message">
285285
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a>
286286

287-
on 2017-05-27
287+
on 2017-06-21
288288

289289
using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
290290
</span>

docs/html/quicksearch.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

lib/Middleware.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ export function compose(...funcs) {
101101
* // apply middleware to target object
102102
* const p = new Person();
103103
* const middlewareManager = new MiddlewareManager(p);
104-
* middlewareManager.use('walk', walk);
104+
* middlewareManager.use('walk', logger);
105105
* p.walk(3);
106106
*
107107
* Whenever a Person instance call it's walk method, we'll see logs from the looger middleware.

0 commit comments

Comments
 (0)