Skip to content

Commit

Permalink
Updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ItalyPaleAle committed Sep 20, 2020
1 parent c24a309 commit 140dad3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
6 changes: 3 additions & 3 deletions Advanced Usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ svelte-spa-router is simple by design. A minimal router is easy to learn and imp
Thanks to the many features of Svelte 3 or other components in the ecosystem, svelte-spa-router can be used to get many more "advanced" features. This document explains how to achieve certain results with svelte-spa-router beyond what's offered by the component itself.

- [Route wrapping](#route-wrapping), including:
- Dynamically-imported routes and components shown while requesting them
- Route pre-conditions ("route guards")
- Adding user data to routes
- [Dynamically-imported routes and placeholders](#async-routes-and-loading-placeholders)
- [Route pre-conditions](#route-pre-conditions) ("route guards")
- [Adding user data to routes](#user-data)
- [`routeEvent` event](#routeevent-event)
- [`routeLoading` and `routeLoaded` events](#routeloading-and-routeloaded-events)
- [Querystring parsing](#querystring-parsing)
Expand Down
21 changes: 14 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,25 @@ Hash-based routing is simpler, works well even without a server, and it's genera

## Sample code

Check out the code in the [example](/example) folder for some usage example. It's a full Svelte app, showcasing all the features of the router.
Check out the code in the [examples](/examples) folder for some usage examples.

To run the sample, clone the repository, install the dependencies, then build the sample:
To run the samples, clone the repository, install the dependencies, then build each sample using Rollup:

````sh
git clone https://github.com/ItalyPaleAle/svelte-spa-router
cd svelte-spa-router
npm install
npm run build-example
npm run start-example

# Navigate to a sample
cd examples/…

# Build and run (in the folder of a sample)
npx rollup -c
npx serve -n -l 5000 dist
````

The sample will be running at http://localhost:5000

## Using svelte-spa-router

You can include the router in any project using Svelte 3.
Expand Down Expand Up @@ -357,9 +364,9 @@ When visiting `#/hola/amigos`, the params prop will be `["/hola/amigos","amigos"
Check out the [Advanced Usage](/Advanced%20Usage.md) documentation for using:

- [Route wrapping](/Advanced%20Usage.md#route-wrapping), including:
- Dynamically-imported routes and components shown while requesting them
- Route pre-conditions ("route guards")
- Adding user data to routes
- [Dynamically-imported routes and placeholders](/Advanced%20Usage.md#async-routes-and-loading-placeholders)
- [Route pre-conditions](/Advanced%20Usage.md#route-pre-conditions) ("route guards")
- [Adding user data to routes](/Advanced%20Usage.md#user-data)
- [`routeEvent` event](/Advanced%20Usage.md#routeevent-event)
- [`routeLoading` and `routeLoaded` events](/Advanced%20Usage.md#routeloading-and-routeloaded-events)
- [Querystring parsing](/Advanced%20Usage.md#querystring-parsing)
Expand Down

0 comments on commit 140dad3

Please sign in to comment.