MobX integration

CodeBud.createMobxStoreMonitor

This method allows you to check MobX state on the MobX tab in GUI.

CodeBud.createMobxStoreMonitor takes 1(2) args

  • store - your MobX store that you wish to inspect
  • [optional] batchingTimeMs - batching time of sending new MobX state copy (in ms). Defaults to 500. Smaller value gives you smaller delay, but slower performance. It is not recommended to pass value smaller than 100
import { reaction } from "mobx";
import { CodeBud } from "@appklaar/codebud";

// Your MobX store
export const mobXStore = new RootStore();

CodeBud.init("YOUR API KEY HERE", INSTRUCTIONS);

// Here we are subscribing for state updates.
reaction(...CodeBud.createMobxStoreMonitor(mobXStore));

That's it. Now you should be able to check MobX state on the MobX tab in GUI (don't forget to add this tab to navigation bar, it can be done on "Other" tab).

CodeBud.createMobxEventHandler

This method allows you to monitor MobX events.

import { spy } from "mobx";
import { CodeBud } from "@appklaar/codebud";

spy(CodeBud.createMobxEventHandler());

That's it. Now you should be able to check MobX events on the Network tab in GUI.

Was this page helpful?