Skip to content

Commit

Permalink
updated documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
nitin42 committed Aug 31, 2018
1 parent 20fffc2 commit a652d02
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![Build Status](https://travis-ci.org/nitin42/react-perf-devtool.svg?branch=master)](https://travis-ci.org/nitin42/react-perf-devtool)
![Release Status](https://img.shields.io/badge/status-stable-brightgreen.svg)
![Author](https://img.shields.io/badge/author-Nitin%20Tulswani-lightgrey.svg)
![current-version](https://img.shields.io/badge/version-3.0.8-blue.svg)
![current-version](https://img.shields.io/badge/version-3.1.8-blue.svg)
![extension](https://img.shields.io/badge/extension-5.3-ff69b4.svg)
> A devtool for inspecting the performance of React Components
Expand Down Expand Up @@ -175,15 +175,20 @@ You can pass an **option** object as an argument to `registerObserver` to enable
{
shouldLog: boolean, // default value: false
port: number // default value: 8080
timeout: number // default value: 2000
}
```

You can pass two properties to the **`option`** object, `shouldLog` and `port`.
You can pass three properties to the **`option`** object, `shouldLog` and `port`.

* `shouldLog` - It takes a **boolean** value. If set to true, measures will be logged to the console.

* `port` - Port number for the server where the measures will be send

* `timeout` - A timeout value to defer the initialisation of the extension.

If your application takes time to load, it's better to defer the initialisation of extension by specifying the timeout value through `timeout` property. This ensures that the extension will load only after your application has properly loaded in the browser so that the updated measures can be rendered. However, you can skip this property if your application is in small size.

**Example**

```js
Expand All @@ -197,7 +202,8 @@ const Component = require('./Component') // Some React Component

const options = {
shouldLog: true,
port: 8080
port: 8080,
timeout: 12000 // Load the extension after 12 sec.
}

function callback(measures) {
Expand Down

0 comments on commit a652d02

Please sign in to comment.