cc05c200793d1fda17b4d2fde9fa91448748d7f6 — Vlad-Stefan Harbuz 9 months ago 5bcd82e main
fix code block language
1 files changed, 4 insertions(+), 4 deletions(-)

M README.md => README.md +4 -4
@@ 36,7 36,7 @@ Shrub will simply make a request for the new page at the usual URL the user woul

First, `npm install shrub-router`. You can then import and initialise it:

import ShrubRouter from 'shrub-router'

@@ 47,7 47,7 @@ page.

To add routes that replace the page body with the fetched page, use `ShrubRouter.add()`:


@@ 55,7 55,7 @@ ShrubRouter.add('/about/details');

If you want to perform a custom action when a route is navigated to, specify a handler to replace the default one:

ShrubRouter.add('/contact', () => {
	document.write("Hello world");

@@ 69,7 69,7 @@ placing your code at the bottom of your HTML. When using Shrub, you obviously wa
initial page load, but also when a page is navigated to. Therefore, you should place all of your in-page Javascript code
within an event listener for `shrub:loaded`:

window.addEventListener('shrub:loaded', () => {
		name: 'Timmy',