@react-native-embrace/action-tracker
v0.2.12
Published
Allows to track the dispatched actions of your state managment
Downloads
9
Readme
React Native Embrace - Redux Tracker
Core Module Required
This module requires React Native Embrace SDK.
Add React Redux Tracker
Adding Context to Sessions
Embrace can collect basic session data and crashes as you've already seen in the Crash Reporting and Session Reporting sections. Embrace can also collect the actions that your app dispatched and its state (SUCCESS AND FAILED) Here's how you add the redux tracker to the session.
Adding the component
Embrace has a separate module for tracking Redux's Actions, to use it you will need to add the React Redux Tracker
Install the component
yarn add @react-native-embrace/action-tracker
npm install @react-native-embrace/action-tracker
Adding the component to your code
Add an useRef for the NavigationContainer and pass it to Embrace's hook
import { applyMiddleware, compose, configureStore } from "@reduxjs/toolkit";
// Import the Embrace's Middleware
import { buildEmbraceMiddleware } from "@react-native-embrace/action-tracker";
// Create the Enhancer that applies the Embrace's Middleware
const middlewareEnhancer = applyMiddleware(buildEmbraceMiddleware());
// Compose your Enhancers with the Embrace's enahncer
const composedEnhancers = compose(middlewareEnhancer);
export default configureStore({
// your reducers
enhancers: [composedEnhancers],
});