svelte-guard-history-router
Advanced tools
Comparing version 1.1.1 to 1.1.2
{ | ||
"name": "svelte-guard-history-router", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"module": "src/index.mjs", | ||
@@ -5,0 +5,0 @@ "svelte": "src/index.svelte", |
@@ -0,1 +1,2 @@ | ||
[![minified size](https://bundlephobia.com/result?p=svelte-guard-history-router)](https://badgen.net/bundlephobia/min/svelte-guard-history-router) | ||
[![npm](https://img.shields.io/npm/v/svelte-guard-history-router.svg)](https://www.npmjs.com/package/svelte-guard-history-router) | ||
@@ -49,2 +50,9 @@ [![Greenkeeper](https://badges.greenkeeper.io/arlac77/svelte-guard-history-router.svg)](https://greenkeeper.io/) | ||
## run tests | ||
```sh | ||
export BROWSER=safari|chrome|... | ||
npm|yarn test | ||
``` | ||
# API | ||
@@ -73,2 +81,3 @@ | ||
- [start](#start) | ||
- [end](#end) | ||
- [redirect](#redirect) | ||
@@ -86,15 +95,22 @@ - [Parameters](#parameters-5) | ||
- [Parameters](#parameters-9) | ||
- [GuardedRoute](#guardedroute) | ||
- [Parameters](#parameters-10) | ||
- [Properties](#properties-5) | ||
- [enter](#enter-1) | ||
- [Parameters](#parameters-11) | ||
- [leave](#leave-1) | ||
- [Parameters](#parameters-12) | ||
- [route](#route-1) | ||
- [Parameters](#parameters-10) | ||
- [Parameters](#parameters-13) | ||
- [Guard](#guard) | ||
- [attach](#attach) | ||
- [Parameters](#parameters-11) | ||
- [enter](#enter-1) | ||
- [Parameters](#parameters-12) | ||
- [leave](#leave-1) | ||
- [Parameters](#parameters-13) | ||
- [Parameters](#parameters-14) | ||
- [enter](#enter-2) | ||
- [Parameters](#parameters-15) | ||
- [leave](#leave-2) | ||
- [Parameters](#parameters-16) | ||
- [sequenceGuard](#sequenceguard) | ||
- [Parameters](#parameters-14) | ||
- [Parameters](#parameters-17) | ||
- [parallelGuard](#parallelguard) | ||
- [Parameters](#parameters-15) | ||
- [Parameters](#parameters-18) | ||
@@ -118,7 +134,14 @@ ## Key | ||
- `route` **[Route](#route)** | ||
- `keys` **[Set](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Set)<[Key](#key)>** | ||
- `params` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** | ||
- `keys` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** all possible keys of all routes | ||
- `params` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** of current route | ||
## Router | ||
key subscriptions: | ||
```js | ||
const aKey = router.keys.aKey; | ||
$aKey // fired if value of aKey changes | ||
``` | ||
### Parameters | ||
@@ -132,7 +155,7 @@ | ||
- `routes` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Route](#route)>** | ||
- `keys` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** | ||
- `params` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** value mapping from keys | ||
- `keys` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** all possible keys of all routes | ||
- `params` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** value mapping from keys (from current route) | ||
- `state` **[RouterState](#routerstate)** | ||
- `route` **[Route](#route)** current | ||
- `transition` **[Transition](#transition)** | ||
- `transition` **[Transition](#transition)** ongoing transition | ||
- `base` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** url | ||
@@ -150,3 +173,4 @@ | ||
Fired when the route (or the target component changes) | ||
Router subscription | ||
Value changes are fired when the route (or the target component changes) | ||
@@ -186,2 +210,6 @@ #### Parameters | ||
### end | ||
cleanup transition | ||
### redirect | ||
@@ -213,3 +241,2 @@ | ||
- `component` **SvelteComponent** target to show | ||
- `guards` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Guard](#guard)>** (optional, default `[]`) | ||
@@ -220,3 +247,2 @@ ### Properties | ||
- `component` **SvelteComponent** target to show | ||
- `guards` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Guard](#guard)>** | ||
- `priority` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** | ||
@@ -244,2 +270,39 @@ - `keys` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>** | ||
## GuardedRoute | ||
**Extends Route** | ||
### Parameters | ||
- `path` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** | ||
- `component` **SvelteComponent** target to show | ||
- `guard` **[Guard](#guard)** | ||
### Properties | ||
- `path` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** | ||
- `component` **SvelteComponent** target to show | ||
- `guard` **[Guard](#guard)** | ||
- `priority` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** | ||
- `keys` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>** | ||
- `regex` **RegEx** | ||
### enter | ||
Enter the route from a former one. | ||
Calls guard enter on all guards present in our gurad but absent in the former one | ||
#### Parameters | ||
- `transition` **[Transition](#transition)** | ||
### leave | ||
Leave the route to a new one. | ||
Calls quard leave on all our guards which are not in the new route | ||
#### Parameters | ||
- `transition` **[Transition](#transition)** | ||
## route | ||
@@ -246,0 +309,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
32391
475
361