@coool/route-node
TypeScript icon, indicating that this package has built-in type declarations

1.1.1 • Public • Published

@coool/route-node

Utilities for easy route node definitions.

Install

$ npm i --save @coool/route-node

Usage

Define routes

export const RouteLocations = {
  Home: new RouteNode('', {
    queryParams: {
      Stay: 'stay',
    },
  }),

  Dashboard: new RouteNode('dashboard', {
    children: {
      Items: new RouteNode('items/:itemId', {
        params: {
          'itemId': 'itemId',
        }
      }),
    },
  }),
};

Use routes

@Get(RouteLocations.Dashboard.children.Items)
public async getItems(
  @Param(RouteLocations.Dashboard.children.Items.params.itemId) itemId: string,
) {
  // ...
}

Package Sidebar

Install

npm i @coool/route-node

Weekly Downloads

6

Version

1.1.1

License

MIT

Unpacked Size

14 kB

Total Files

15

Last publish

Collaborators

  • hacklone