1.0.3 • Published 4 years ago

@becklyn/router v1.0.3

Weekly downloads
130
License
-
Repository
github
Last release
4 years ago

Symfony JavaScript Router

This is a modern implementation of the JS router for generation Symfony routes. Best to be used with the JavaScript routing bundle.

Initialization

For example like this (using mojave):

import {initFromGlobalData} from "mojave/init"; 
import {Router} from "@becklyn/router";

let router = initFromGlobalData("RouterInit", new Router());

A manual way to wire it up to global data is like this:

function loadGlobalData (key, handler)
{
    if (undefined === window[key])
    {
        return;
    }

    // replace global callback
    window[key].init = (data) => handler.init(data);
    // handle current data
    handler.init(window[key].data);
}

let router = new Router();
loadGlobalData("RouterInit", router);
1.0.3

4 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago