API docs signature fixes for route resolver, jsonp, fragment

This commit is contained in:
spacejack 2017-02-11 21:31:10 -05:00
parent 75b20e86e8
commit 7e0a1db89f
3 changed files with 17 additions and 16 deletions

View file

@ -35,11 +35,11 @@ Generates a fragment [vnode](vnodes.md)
`vnode = m.fragment(attrs, children)` `vnode = m.fragment(attrs, children)`
Argument | Type | Required | Description Argument | Type | Required | Description
----------- | ------------------------------------ | -------- | --- ----------- | --------------------------------------------------- | -------- | ---
`attrs` | `Object` | Yes | A map of attributes `attrs` | `Object` | Yes | A map of attributes
`children` | `Array<Vnode>|String|Number|Boolean` | Yes | A list of vnodes `children` | `Array<Vnode|String|Number|Boolean|null|undefined>` | Yes | A list of vnodes
**returns** | `Vnode` | | A fragment [vnode](vnodes.md) **returns** | `Vnode` | | A fragment [vnode](vnodes.md)
[How to read signatures](signatures.md) [How to read signatures](signatures.md)

View file

@ -36,6 +36,7 @@ Argument | Type | Required | Descript
`options.type` | `any = Function(any)` | No | A constructor to be applied to each object in the response. Defaults to the [identity function](https://en.wikipedia.org/wiki/Identity_function). `options.type` | `any = Function(any)` | No | A constructor to be applied to each object in the response. Defaults to the [identity function](https://en.wikipedia.org/wiki/Identity_function).
`options.callbackName` | `String` | No | The name of the function that will be called as the callback. Defaults to a randomized string (e.g. `_mithril_6888197422121285_0({a: 1})` `options.callbackName` | `String` | No | The name of the function that will be called as the callback. Defaults to a randomized string (e.g. `_mithril_6888197422121285_0({a: 1})`
`options.callbackKey` | `String` | No | The name of the querystring parameter name that specifies the callback name. Defaults to `callback` (e.g. `/someapi?callback=_mithril_6888197422121285_0`) `options.callbackKey` | `String` | No | The name of the querystring parameter name that specifies the callback name. Defaults to `callback` (e.g. `/someapi?callback=_mithril_6888197422121285_0`)
`options.background` | `Boolean` | No | If `false`, redraws mounted components upon completion of the request. If `true`, it does not. Defaults to `false`.
**returns** | `Promise` | | A promise that resolves to the response data, after it has been piped through `type` method **returns** | `Promise` | | A promise that resolves to the response data, after it has been piped through `type` method
[How to read signatures](signatures.md) [How to read signatures](signatures.md)

View file

@ -123,11 +123,11 @@ For more information on `onmatch`, see the [advanced component resolution](#adva
`routeResolver.onmatch(args, requestedPath)` `routeResolver.onmatch(args, requestedPath)`
Argument | Type | Description Argument | Type | Description
--------------- | ------------------------------ | --- --------------- | ---------------------------------------- | ---
`args` | `Object` | The [routing parameters](#routing-parameters) `args` | `Object` | The [routing parameters](#routing-parameters)
`requestedPath` | `String` | The router path requested by the last routing action, including interpolated routing parameter values, but without the prefix. When `onmatch` is called, the resolution for this path is not complete and `m.route.get()` still returns the previous path. `requestedPath` | `String` | The router path requested by the last routing action, including interpolated routing parameter values, but without the prefix. When `onmatch` is called, the resolution for this path is not complete and `m.route.get()` still returns the previous path.
**returns** | `Component|Promise<Component>` | Returns a component or a promise that resolves to a component **returns** | `Component|Promise<Component>|undefined` | Returns a component or a promise that resolves to a component
If `onmatch` returns a component or a promise that resolves to a component, this component is used as the `vnode.tag` for the first argument in the RouteResolver's `render` method. Otherwise, `vnode.tag` is set to `"div"`. Similarly, if the `onmatch` method is omitted, `vnode.tag` is also `"div"`. If `onmatch` returns a component or a promise that resolves to a component, this component is used as the `vnode.tag` for the first argument in the RouteResolver's `render` method. Otherwise, `vnode.tag` is set to `"div"`. Similarly, if the `onmatch` method is omitted, `vnode.tag` is also `"div"`.
@ -139,11 +139,11 @@ The `render` method is called on every redraw for a matching route. It is simila
`vnode = routeResolve.render(vnode)` `vnode = routeResolve.render(vnode)`
Argument | Type | Description Argument | Type | Description
------------------- | --------------- | ----------- ------------------- | -------------------- | -----------
`vnode` | `Object` | A [vnode](vnodes.md) whose attributes object contains routing parameters. If onmatch does not return a component or a promise that resolves to a component, the vnode's `tag` field defaults to `"div"` `vnode` | `Object` | A [vnode](vnodes.md) whose attributes object contains routing parameters. If onmatch does not return a component or a promise that resolves to a component, the vnode's `tag` field defaults to `"div"`
`vnode.attrs` | `Object` | A map of URL parameter values `vnode.attrs` | `Object` | A map of URL parameter values
**returns** | `Vnode` | Returns a vnode **returns** | `Vnode|Array<Vnode>` | Returns a vnode or array of vnodes
--- ---
@ -501,7 +501,7 @@ For the sake of simplicity, in the example above, the user's logged in status is
var Auth = { var Auth = {
username: "", username: "",
password: "", password: "",
setUsername: function(value) { setUsername: function(value) {
Auth.username = value Auth.username = value
}, },