npm package: @roxi/routify-test
Description: ## Using Routify
Author: jakobrosenberg@gmail.com
Latest version: 3.0.0-2

# Routify 3

## Using Routify

#### Creating a Routify instance

```javascript
const instance = new Routify({/* options */})
```

#### Creating a router
Basic
```html
<script>
    import { Router } from '@roxi/routify'
    import { routes } from '../.routify/routes.default.js'
</script>

<Router {routes} />
```

Create instance manually
```html
<script>
    import { Routify, Router } from '@roxi/routify'
    import { routes } from '../.routify/routes.default.js'
    const instance = new Routify({ routes, /* options */ })
</script>

<Router {instance} />
```

#### Creating nodes

```javascript
// create a root node
const rootNode = instance.superNode.createChild('my-root-node')

// create a page node
rootNode.createChild('im-page-1', module)
rootNode.createChild('im-page-2', module)

// Note: module can be a module or its path
```

#### Appending nodes

```javascript
// create a root node
const rootNode = instance.createNode('my-root-node')
instance.superNode.appendChild(rootNode)

// create a page node
const childNode = instance.createNode('my-child-node')
rootNode.appendChild(childNode)
```

## Structure *(draft)*

* Global *(class)*
    *   Instance *(class)*
        *   nodeIndex *(array)*
        *   superNode *(class)*
        *   Router\* *(module)*
            *   Router *(class)*
                *   params
                *   activeUrl\*\* *(ActiveUrl)*
                *   activeRoute\*\* *(Route)*
                    *   fragments *(RouteFragment\[])*
            *   module\* *(module)*
                *   module\* *(module)*
                    *   module\* *(module)* ...

<small>
*: module

\*\*: Store </small>

## API

<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

#### Table of Contents

*   [RoutifyRuntimePayload](#routifyruntimepayload)
*   [RoutifyCallback](#routifycallback)
    *   [Parameters](#parameters)
*   [RoutifyPlugin](#routifyplugin)
    *   [Properties](#properties)
*   [PathNode](#pathnode)
    *   [Properties](#properties-1)

### RoutifyRuntimePayload

Type: {instance: RoutifyRuntime}

### RoutifyCallback

Type: [Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)

#### Parameters

*   `first` **{instance: Routify}** 

Returns **(T | [Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<T>)** 

### RoutifyPlugin

Type: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)

#### Properties

*   `before` **([string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) | [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>)?** name of plugin(s) to run before
*   `after` **([string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) | [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>)?** name of plugin(s) to run after
*   `condition` **[RoutifyCallback](#routifycallback)<[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)>?** run plugin if true
*   `run` **[RoutifyCallback](#routifycallback)\<any>** plugin script
*   `mode` **(`"compile"` | `"runtime"`)** 

### PathNode

Type: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)

#### Properties

*   `urlFragment` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
*   `node` **RNodeRuntime**