API References
#
parsedThis is the default export. We use to create the parsed tag helper method. Return a function that accepts a tagged template literal and turns it into a pathname.
v2: https://tsei.jp/api/v2
#
Adapting based on propsYou can pass a function to a parsed path's template literal to adapt it based on its props. When setting the next prop to true, we are switching its version number.
Get: api/v2/get
#
Extending parsesTo easily make a new pathname that inherits from another paths. Here we use the api url from the last section and create a special one.
Dev: http://tsei.jp/api
#
Parsing any pathnameThe parsed method works perfectly on all of your own or any third-party pathname.
Api: /port:3001;root:http://;
#
Attaching additional propsTo avoid unnecessary wrappers that just pass on some props to the path, you can use the .withAttrs constructor. It allows you to attach additional props to a path.
Furthermore you can also attach more dynamic props to a component. The .withAttrs object also takes functions, that receive the props that the path receives. The return value will be merged into the resulting props as well.
Here we render an root path and attach some dynamic and static attributes to it:
This allows each wrapper to override nested uses of .withAttrs. Root's .attrs are applied first, and then Api's .attrs:
Dev: tsei.jpapi/v1
Pro: tsei.jpapi/v1