docs: describe callback param to Redoc.init

fixes #381
This commit is contained in:
Roman Hotsiy 2018-06-01 18:37:35 +03:00
parent 209c6caca0
commit 9a34f22aff
No known key found for this signature in database
GPG Key ID: 5CB7B3ACABA57CB0

View File

@ -212,12 +212,13 @@ You can use all of the following options with standalone version on <redoc> tag
## Advanced usage of standalone version
Instead of adding `spec-url` attribute to the `<redoc>` element you can initialize ReDoc via globally exposed `Redoc` object:
```js
Redoc.init(specOrSpecUrl, options, element)
Redoc.init(specOrSpecUrl, options, element, callback?)
```
- `specOrSpecUrl` is either JSON object with specification or an URL to the spec in `JSON` or `YAML` format
- `options` [options object](#redoc-options-object)
- `element` DOM element to put ReDoc into
- `callback` (optional) - callback to be called after Redoc has been fully rendered
```js
Redoc.init('http://petstore.swagger.io/v2/swagger.json', {