Navigation
Last updated
Last updated
The library provides intuitive navigation options to seamlessly transition between pages and initiate GET or POST requests.
Initiating a GET request or navigating to a new page is straightforward. Such actions will correspond to a get
router, with the request parameter converting into an instance of URLSearchParams for the request.
path (string): Specifies the URI, which can be a regular path or a hash.
request (object): Sends a GET request or query string to the dispatcher. This will be transformed into an instance of . When executed in a browser, the query string will also be appended to the URL in the address field.
The above navigation will trigger the result for the matching router:
Creating a POST request is similarly efficient, targeting a post
router. The request parameter will be an object to facilitate the request.
path (string): Defines the URI, which can be a regular path or a hash.
request (object): Submits a POST request to the dispatcher. This will be an object, allowing for detailed and structured data transmission.
The above post will trigger the result for the matching router: