fix(tracker): fix mobx readme

This commit is contained in:
nick-delirium 2023-05-24 12:02:54 +02:00
parent ce4d625c36
commit 3bd8eb955e
2 changed files with 7 additions and 5 deletions

View file

@ -1,5 +1,6 @@
# OpenReplay Tracker MobX plugin # OpenReplay Tracker MobX plugin
A MobX plugin for OpenReplay Tracker. This plugin allows you to see the MobX events during session replay. A MobX plugin for OpenReplay Tracker.
This plugin allows you to see the MobX events during session replay.
## Installation ## Installation
```bash ```bash
@ -8,7 +9,7 @@ npm i @openreplay/tracker-mobx
## Usage ## Usage
Initialize the `@openreplay/tracker` package as usual and load the plugin into it. Initialize the `@openreplay/tracker` package as usual and load the plugin into it.
Then put the generated middleware into your Redux chain. Then put is as a second argument to `observe` function from `mobx` package.
```js ```js
import Tracker from '@openreplay/tracker'; import Tracker from '@openreplay/tracker';
@ -27,8 +28,8 @@ Options:
```js ```js
interface Options { interface Options {
predicate?: (ev: { type: string; name: string; object: any; debugObjectName: string }) => boolean; predicate?: (observeEvent: { type: string; name: string; object: any; debugObjectName: string }) => boolean;
sanitize?: (ev: { state: any; type: string; property: string }) => { state: any; type: string; property: string }; sanitize?: (resultAction: { state: any; type: string; property: string }) => { state: any; type: string; property: string };
update?: boolean; update?: boolean;
add?: boolean; add?: boolean;
delete?: boolean; delete?: boolean;
@ -41,3 +42,4 @@ trackerMobX({
``` ```
Where `predicate` can be used to dynamically turn off capturing and `sanitize` can be used to modify the payload before sending it to backend. Where `predicate` can be used to dynamically turn off capturing and `sanitize` can be used to modify the payload before sending it to backend.
Most of the actions fall into `update` type, refer to mobx documentation for more details about add and delete (mostly for Maps)

View file

@ -1,7 +1,7 @@
{ {
"name": "@openreplay/tracker-mobx", "name": "@openreplay/tracker-mobx",
"description": "Tracker plugin for MobX events recording", "description": "Tracker plugin for MobX events recording",
"version": "4.0.0", "version": "4.0.1",
"keywords": [ "keywords": [
"mobx", "mobx",
"logging", "logging",