Skip to content

Commit

Permalink
Revert "demonstrating how to stop recording (rrweb-io#20)"
Browse files Browse the repository at this point in the history
This reverts commit d25a96e.
  • Loading branch information
mohosos authored Jan 3, 2019
1 parent e4109b8 commit 42f3531
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ rrweb does **not** support IE11 and below, because it uses the `MutationObserver
### Record

If you only include record code with `<script>`, then you can use the global variable `rrwebRecord` which is the same as `rrweb.record`.
The following sample code will use the variable `rrweb` which is the default exporter of this library.
The following sample codes will use the variable `rrweb` which is the default exporter of this library.

```js
rrweb.record({
Expand All @@ -58,19 +58,7 @@ rrweb.record({
});
```

During recording, the recorder will emit when there is some event incurred, all you need to do is to store the emitted events in any way you like.

The `record` method returns a function which can be called to stop events from firing:

```js
let stopFn = rrweb.record({
emit(event) {
if(events.length > 100){ //stop after 100 events
stopFn();
}
}
});
```
During recording, the recorder will emit when there is some event incurred, all you need to do is to store the emitted events in any way you like.

A more real-world usage may looks like this:

Expand Down

0 comments on commit 42f3531

Please sign in to comment.