@becklyn/router
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

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);

Readme

Keywords

none

Package Sidebar

Install

npm i @becklyn/router

Weekly Downloads

6

Version

1.0.3

License

none

Unpacked Size

10.3 kB

Total Files

8

Last publish

Collaborators

  • jj_becklyn
  • mangoischke
  • marc_hessenauer
  • msc-at-becklyn
  • hautzi
  • dsmoosh-becklyn
  • timfuhrmann
  • jesko-plitt
  • msvujnovic-becklyn