Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/KidkArolis/space-router
Framework agnostic router for single page apps
https://github.com/KidkArolis/space-router
browser callback hash pushstate react router
Last synced: 3 months ago
JSON representation
Framework agnostic router for single page apps
- Host: GitHub
- URL: https://github.com/KidkArolis/space-router
- Owner: KidkArolis
- License: isc
- Created: 2017-03-12T15:06:54.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-05-01T11:19:52.000Z (6 months ago)
- Last Synced: 2024-07-19T09:16:55.862Z (4 months ago)
- Topics: browser, callback, hash, pushstate, react, router
- Language: JavaScript
- Homepage: https://kidkarolis.github.io/space-router/
- Size: 5.08 MB
- Stars: 38
- Watchers: 3
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
Space Router
Framework agnostic router for single page apps
Space Router packs all the features you need to keep your app in sync with the url. It's distinct from many other routers in that there is only **a single callback**. This callback can be used to re-render your applocation, update a store and perform other actions on each url change. Space Router is **stateless**, it doesn't store the current route leaving state completely up to you to handle.
In summary, Space Router:
- listens to url changes using popstate or hashchange event
- extracts url parameters and parses query strings
- supports nested routes and arbitrary route metadata
- fits into a wide range of application architectures and frameworks
- has no dependencies and weighs less than 2kb## Install
npm i space-router
## API
See the [API Docs](https://kidkarolis.github.io/space-router/) for more details.