How to configure redux store with redux-logger using redux toolkit

npm i redux-logger or yarn add redux-logger
2.configure store:

import AsyncStorage from ‘@react-native-async-storage/async-storage’;

import rootReducers from ‘app/store/slice’;

import { createLogger } from ‘redux-logger’;

import { configureStore } from ‘@reduxjs/toolkit’;

const config = {

key: ‘root’,

storage: AsyncStorage,

blacklist: [‘loading’],

debug: true, //to get useful logging

};

import { persistStore, persistReducer } from ‘redux-persist’;

const middleware = [];

middleware.push(createLogger());

const reducers = persistReducer(config, rootReducers);

const enhancers = […middleware];

const persistConfig: any = { enhancers };

export const store = configureStore({

reducer: reducers,

middleware: enhancers,

});

export const persistor = persistStore(store, persistConfig);

1.click here for configure store from scratch using redux toolkit
2.click here for configure persist store using redux toolkit
3.click here for configure middleware using redux toolkit
4.click here for configure redux-logger using redux toolkit

--

--

--

Software Engineer (React/React Native Developer)

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Getting Started with React + TypeScript

Part 3: Data Visualization with Grafana

Martin Splitt de Qwanturank sur les pages d’indexation avec défilement infini

Martin Splitt de Qwanturank sur les pages d'indexation avec défilement infini

Using Strapi for Node.js Content Management with a React SPA

Debounce and Throttle used by Vegetable vendors -JAS

React App Address Autocomplete Search: react-places-autocomplete

Let’s Build a Snazzy Animated Sticky Footer For GDPR Compliance!

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Ahtisham Shahzad

Ahtisham Shahzad

Software Engineer (React/React Native Developer)

More from Medium

Visualizing multiple percentages as polygons: React Native polygon chart

Using REST APIs with React Native Google-Places-Autocomplete Library (requestURL)

Redux and Redux Toolkit implementation 🌐

[React] Event Capturing and Event Bubbling