elm-spa/README.md

40 lines
991 B
Markdown
Raw Normal View History

2019-11-06 02:37:10 +03:00
# elm-spa
2020-03-28 09:46:45 +03:00
[![Build Status](https://travis-ci.org/ryannhg/elm-spa.svg?branch=master)](https://travis-ci.org/ryannhg/elm-spa)
2020-03-27 07:35:43 +03:00
single page apps made easy
2020-03-27 07:43:08 +03:00
### try it out
2020-03-27 07:35:43 +03:00
2020-03-27 07:43:08 +03:00
```
npx elm-spa init new-project
```
2020-03-27 07:35:43 +03:00
2020-03-27 07:43:08 +03:00
### or just install the elm package
2020-03-27 07:43:08 +03:00
```
elm install ryannhg/elm-spa
```
2020-03-27 07:43:08 +03:00
### or run the example
2020-03-27 07:43:08 +03:00
```
cd example && npm start
2020-03-27 07:46:52 +03:00
```
### overview
When you create an app with the [elm/browser](https://package.elm-lang.org/packages/elm/browser/latest) package, you can build anything from a static `Html msg` page to a fully-fledged web `Browser.application`.
`elm-spa` uses that design at the page-level, so you can quickly add new pages to your Elm application!
## the four kinds of pages:
1. __static__ a page that only renders HTML.
2. __sandbox__ a page with state.
3. __element__ a page with side-effects.
4. __component__ a page with global state.
Check out [the package docs](https://package.elm-lang.org/packages/ryannhg/elm-spa/latest/Spa) to learn more!