Skip to content

Commit ee9625e

Browse files
committed
readme: fix spa examples
1 parent 8732981 commit ee9625e

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

README.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -698,6 +698,7 @@ import {spa, html} from "@e280/sly"
698698
- the router has an effect on the appearance of the url in the browser address bar -- the home `#/` is removed, aesthetically, eg, `e280.org/#/` is rewritten to `e280.org` using *history.replaceState*
699699
- you can provide `loader` option if you want to specify the loading spinner (defaults to `loaders.make()`)
700700
- you can provide `notFound` option, if you want to specify what is shown on invalid routes (defaults to `() => null`)
701+
- when `auto` is true (default), the router calls `.refresh()` and `.listen()` in the constructor.. set it to `false` if you want manual control
701702
- you can set `auto` option false if you want to omit the default initial refresh and listen calls
702703
- **render your current page**
703704
```ts
@@ -728,18 +729,12 @@ import {spa, html} from "@e280/sly"
728729
const hash = router.nav.user.hash("123")
729730
// "#/user/123"
730731

731-
return html`
732-
<a href="${hash}">user 123</a>
733-
`
732+
html`<a href="${hash}">user 123</a>`
734733
```
735734
- **check if a route is the currently-active one**
736735
```ts
737736
const hash = router.nav.user.active
738737
// true
739-
740-
return html`
741-
<a href="${hash}">user 123</a>
742-
`
743738
```
744739
- **force-refresh the router**
745740
```ts

0 commit comments

Comments
 (0)