Fix docs about params (#377)
This commit is contained in:
@@ -482,10 +482,10 @@ registered in `choo(handlers)`. If no callback is registered, errors will
|
|||||||
Creates a new router. Takes a function that exposes a single `route` function,
|
Creates a new router. Takes a function that exposes a single `route` function,
|
||||||
and that expects a tree of `routes` to be returned. See [sheet-router] for full
|
and that expects a tree of `routes` to be returned. See [sheet-router] for full
|
||||||
documentation. Registered views have a signature of `(state, prev, send)`,
|
documentation. Registered views have a signature of `(state, prev, send)`,
|
||||||
where `state` is the current `state`, `prev` is the last state, `state.params`
|
where `state` is the current `state`, `prev` is the last state,
|
||||||
is URI partials and `send()` can be called to trigger actions. If
|
`state.location.params` is URI partials and `send()` can be called to trigger
|
||||||
`defaultRoute` is passed in, that will be called if no paths match. If no
|
actions. If `defaultRoute` is passed in, that will be called if no paths match.
|
||||||
`defaultRoute` is specified it will throw instead.
|
If no `defaultRoute` is specified it will throw instead.
|
||||||
|
|
||||||
### app.use(hooks)
|
### app.use(hooks)
|
||||||
Register an object of hooks on the application. This is useful to extend the
|
Register an object of hooks on the application. This is useful to extend the
|
||||||
@@ -546,9 +546,9 @@ Start the application. Returns a tree of DOM nodes that can be mounted using
|
|||||||
|
|
||||||
### view = require('choo/html')\`html\`
|
### view = require('choo/html')\`html\`
|
||||||
Tagged template string HTML builder. Built on top of [yo-yo], [bel], and
|
Tagged template string HTML builder. Built on top of [yo-yo], [bel], and
|
||||||
[hyperx]. To register a view on the `router` it should be wrapped
|
[hyperx]. To register a view on the `router` it should be wrapped in a function
|
||||||
in a function with the signature of `(state, prev, send)` where `state` is the
|
with the signature of `(state, prev, send)` where `state` is the current
|
||||||
current `state`, `prev` is the last state, `state.params` is URI partials and
|
`state`, `prev` is the last state, `state.location.params` is URI partials and
|
||||||
`send()` can be called to trigger actions.
|
`send()` can be called to trigger actions.
|
||||||
|
|
||||||
To create listeners for events, create interpolated attributes on elements.
|
To create listeners for events, create interpolated attributes on elements.
|
||||||
|
|||||||
Reference in New Issue
Block a user