charton API / @chart-on/core / index / DataSourceRouterOptions
Interface: DataSourceRouterOptions
Defined in: packages/core/src/data/router.ts:19
Options for createDataSourceRouter: the prefix separator, the route for unprefixed symbols, and a handler for failed route searches.
Properties
defaultRoute?
optionaldefaultRoute?:string
Defined in: packages/core/src/data/router.ts:26
Prefix of the route that answers symbols without a known prefix; without it they fail to resolve. Their resolved symbols carry the prefix.
separator?
optionalseparator?:string
Defined in: packages/core/src/data/router.ts:21
Between a route's prefix and the feed's symbol (default ':'). Only the first one splits.
Methods
onError()?
optionalonError(error,route):void
Defined in: packages/core/src/data/router.ts:32
Hears about a route whose symbol search failed; the other routes' results are still returned. Without it, development builds log a search-route-failed warning, once per route.
Parameters
error
unknown
route
name
string
prefix
string
Returns
void