Skip to content

Commit

Permalink
Fix inconsistencies in the code documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhorak committed Aug 17, 2019
1 parent 432fd42 commit a5c1b61
Show file tree
Hide file tree
Showing 15 changed files with 28 additions and 28 deletions.
2 changes: 1 addition & 1 deletion docs/history.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ <h1 class="page-title">history.js</h1>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Aug 16 2019 20:47:45 GMT-0400 (Eastern Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sat Aug 17 2019 08:25:30 GMT-0400 (Eastern Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
14 changes: 7 additions & 7 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -534,12 +534,12 @@ <h4>Create a Navigation Guard</h4><pre class="prettyprint source lang-javascript

// The guard callback is called when a navigation occurs,
// the next function must be called to continue the navigation.
$router.navigationGuard((to, from, next) => {
$router.navigationGuard((from, to, next) => {
next();
});</code></pre><blockquote>
<p>Note: the <strong>router</strong> can be accessed after the <strong>createRouter</strong> function is executed, and it must be accessed as <strong>$router</strong> since it is Svelte read-able store object.</p>
</blockquote>
<p>to, from are <a href="#route-object">Route Object</a>.</p>
<p>&quot;from, to&quot; are <a href="#route-object">Route Object</a>.</p>
<h4>Navigation Guard Next Action</h4><h5>Continue</h5><pre class="prettyprint source lang-javascript"><code>next();</code></pre><p>Move on to the next hook in the pipeline. If no hooks are left, the navigation is confirmed.</p>
<h5>Abort</h5><pre class="prettyprint source lang-javascript"><code>next(false);</code></pre><p>Abort the current navigation.</p>
<h5>Redirect</h5><pre class="prettyprint source lang-javascript"><code>// URL
Expand Down Expand Up @@ -746,12 +746,12 @@ <h4>navigationGuard</h4><p>Register a navigation guard which will be called when
<tbody>
<tr>
<td style="text-align:left">guard</td>
<td style="text-align:left">guard callback function with (to, from, next) signature. Please see <a href="#navigation-guard-next-action">Navigation Guard Next Action</a></td>
<td style="text-align:left">guard callback function with (from, to, next) signature. Please see <a href="#navigation-guard-next-action">Navigation Guard Next Action</a></td>
<td style="text-align:left">function</td>
</tr>
</tbody>
</table>
<p>to, from are <a href="#route-object">Route Object</a>.</p>
<p>&quot;from, to&quot; are <a href="#route-object">Route Object</a>.</p>
<h4>onBeforeNavigation</h4><p>Register a callback which will be called before execution of navigation guards.</p>
<pre class="prettyprint source lang-javascript"><code>const unregister = $router.onBeforeNavigation(callback);

Expand All @@ -775,7 +775,7 @@ <h4>onBeforeNavigation</h4><p>Register a callback which will be called before ex
</tr>
</tbody>
</table>
<p>to, from are <a href="#route-object">Route Object</a>.</p>
<p>&quot;from, to&quot; are <a href="#route-object">Route Object</a>.</p>
<h4>onNavigationChanged</h4><p>Register a callback which will be called when all navigation guards are resolved, and the final navigation change is resolved.</p>
<pre class="prettyprint source lang-javascript"><code>const unregister = $router.onNavigationChanged(callback);

Expand All @@ -799,7 +799,7 @@ <h4>onNavigationChanged</h4><p>Register a callback which will be called when all
</tr>
</tbody>
</table>
<p>to, from are <a href="#route-object">Route Object</a>.</p>
<p>&quot;from, to&quot; are <a href="#route-object">Route Object</a>.</p>
<h4>onError</h4><p>Register a callback which will be called when an error is caught during a route navigation.</p>
<pre class="prettyprint source lang-javascript"><code>const unregister = $router.onError(callback);

Expand Down Expand Up @@ -994,7 +994,7 @@ <h2>License</h2><p>Svelte Router is released under the MIT license. See <a href=
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Aug 16 2019 20:47:45 GMT-0400 (Eastern Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sat Aug 17 2019 08:25:30 GMT-0400 (Eastern Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/index.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ <h1 class="page-title">index.js</h1>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Aug 16 2019 20:47:45 GMT-0400 (Eastern Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sat Aug 17 2019 08:25:30 GMT-0400 (Eastern Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/location.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ <h1 class="page-title">location.js</h1>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Aug 16 2019 20:47:45 GMT-0400 (Eastern Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sat Aug 17 2019 08:25:30 GMT-0400 (Eastern Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
4 changes: 2 additions & 2 deletions docs/module-svelte-router.Router.html
Original file line number Diff line number Diff line change
Expand Up @@ -1129,7 +1129,7 @@ <h5>Parameters:</h5>


<td class="description last"><p>guard callback function
with (to, from, next) signature.</p></td>
with (from, to, next) signature.</p></td>
</tr>


Expand Down Expand Up @@ -2387,7 +2387,7 @@ <h4 class="name" id="start"><span class="type-signature"></span>start<span class
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Aug 16 2019 20:47:45 GMT-0400 (Eastern Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sat Aug 17 2019 08:25:30 GMT-0400 (Eastern Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/module-svelte-router.html
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ <h5>Type:</h5>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Aug 16 2019 20:47:45 GMT-0400 (Eastern Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sat Aug 17 2019 08:25:30 GMT-0400 (Eastern Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/module-svelte-router_history.html
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,7 @@ <h5>Returns:</h5>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Aug 16 2019 20:47:45 GMT-0400 (Eastern Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sat Aug 17 2019 08:25:30 GMT-0400 (Eastern Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/module-svelte-router_location.html
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,7 @@ <h5 class="subsection-title">Properties:</h5>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Aug 16 2019 20:47:45 GMT-0400 (Eastern Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sat Aug 17 2019 08:25:30 GMT-0400 (Eastern Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/module-svelte-router_route.html
Original file line number Diff line number Diff line change
Expand Up @@ -1790,7 +1790,7 @@ <h5 class="subsection-title">Properties:</h5>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Aug 16 2019 20:47:45 GMT-0400 (Eastern Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sat Aug 17 2019 08:25:30 GMT-0400 (Eastern Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/module-svelte-router_utils.html
Original file line number Diff line number Diff line change
Expand Up @@ -2244,7 +2244,7 @@ <h5 class="subsection-title">Properties:</h5>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Aug 16 2019 20:47:45 GMT-0400 (Eastern Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sat Aug 17 2019 08:25:30 GMT-0400 (Eastern Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/route.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ <h1 class="page-title">route.js</h1>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Aug 16 2019 20:47:45 GMT-0400 (Eastern Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sat Aug 17 2019 08:25:30 GMT-0400 (Eastern Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
4 changes: 2 additions & 2 deletions docs/router.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ <h1 class="page-title">router.js</h1>
* Navigation guard must call the next() function to continue
* the execution of navigation change.
* @param {function} guard guard callback function
* with (to, from, next) signature.
* with (from, to, next) signature.
* @return {function} remove guard function.
*/
navigationGuard(guard) {
Expand Down Expand Up @@ -811,7 +811,7 @@ <h1 class="page-title">router.js</h1>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Aug 16 2019 20:47:45 GMT-0400 (Eastern Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sat Aug 17 2019 08:25:30 GMT-0400 (Eastern Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/utils.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ <h1 class="page-title">utils.js</h1>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Aug 16 2019 20:47:45 GMT-0400 (Eastern Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sat Aug 17 2019 08:25:30 GMT-0400 (Eastern Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
12 changes: 6 additions & 6 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -472,13 +472,13 @@ import {router} from '@spaceavocado/svelte-router';
// The guard callback is called when a navigation occurs,
// the next function must be called to continue the navigation.
$router.navigationGuard((to, from, next) => {
$router.navigationGuard((from, to, next) => {
next();
});
```
> Note: the **router** can be accessed after the **createRouter** function is executed, and it must be accessed as **$router** since it is Svelte read-able store object.
to, from are [Route Object](#route-object).
"from, to" are [Route Object](#route-object).
#### Navigation Guard Next Action
##### Continue
Expand Down Expand Up @@ -653,9 +653,9 @@ Parameters:
| Name | Description | Type |
| :----------- | :---------------------------------------- | :------------------------------------ |
| guard | guard callback function with (to, from, next) signature. Please see [Navigation Guard Next Action](#navigation-guard-next-action) | function |
| guard | guard callback function with (from, to, next) signature. Please see [Navigation Guard Next Action](#navigation-guard-next-action) | function |
to, from are [Route Object](#route-object).
"from, to" are [Route Object](#route-object).
#### onBeforeNavigation
Register a callback which will be called before execution of navigation guards.
Expand All @@ -673,7 +673,7 @@ Parameters:
| :----------- | :---------------------------------------- | :------------------------------------ |
| callback | callback function with fn(from, to) signature. | function |
to, from are [Route Object](#route-object).
"from, to" are [Route Object](#route-object).
#### onNavigationChanged
Register a callback which will be called when all navigation guards are resolved, and the final navigation change is resolved.
Expand All @@ -691,7 +691,7 @@ Parameters:
| :----------- | :---------------------------------------- | :------------------------------------ |
| callback | callback function with fn(from, to) signature. | function |
to, from are [Route Object](#route-object).
"from, to" are [Route Object](#route-object).
#### onError
Register a callback which will be called when an error is caught during a route navigation.
Expand Down
2 changes: 1 addition & 1 deletion src/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class Router {
* Navigation guard must call the next() function to continue
* the execution of navigation change.
* @param {function} guard guard callback function
* with (to, from, next) signature.
* with (from, to, next) signature.
* @return {function} remove guard function.
*/
navigationGuard(guard) {
Expand Down

0 comments on commit a5c1b61

Please sign in to comment.