0.2.7 • Published 6 years ago

hyperapp-hoa-router v0.2.7

Weekly downloads
2
License
ISC
Repository
github
Last release
6 years ago

A Hyperapp Router

Demo

Quick Start

import { app } from 'hyperapp'
import { createHashHistory } from 'history'
import { withRouter, routerFactory } from 'hyperapp-hoa-router'
import App from './components/App'

const history = createHashHistory()

const config = {
  factories: [routerFactory(history)]
}

withRouter(app, config)({}, {}, App, document.body)

or

import { app } from 'hyperapp'
import { createHashHistory } from 'history'
import { init, routerFactory } from 'hyperapp-hoa-router'
import App from './App'

init('router')
const router = routerFactory(createHashHistory())
const main = app(
  { router: router.state },
  { router: router.actions },
  App,
  document.body
)
router.sub(main)

Components

Components are basically identify with hyperapp/router components

  • Route

  • Switch

  • Link

  • Redirect

Dependencies Reference

Hyperapp: 1 kB JavaScript framework for building web applications.

History: Easily manage session history anywhere JavaScript runs. Abstracts away the differences in various environments and provides a minimal API that lets you manage the history stack, navigate, confirm navigation, and persist state between sessions.

0.2.7

6 years ago

0.2.6

6 years ago

0.2.5

6 years ago

0.2.4

6 years ago

0.2.3

6 years ago

0.2.2

6 years ago

0.1.1

6 years ago

0.1.0

7 years ago

0.0.10

7 years ago

0.0.9

7 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago