Я пробовал много разных способов на своем сайте действий, но проблема все та же, когда я выпускаю файл Android apk. Извините за то, что я новичок в redux-persist, когда он в режиме отладки все работает нормально.
это ошибка при использовании adb logcat
redux-persist: cannot process cyclical state.
Consider changing your state structure to have no cycles.
Alternatively blacklist the corresponding reducer key.
Cycle encounted at key "_firestore" with value "[object Object]".
Это мой код действия
try {
let pendingPostList =[]
let postList=[]
let user = {}
const userId = await AsyncStorage.getItem('uid')
userrRef = firestore.collection('user').doc(userId)
await userrRef.get().then((val)=>{
user = val.data()
})
await Promise.all(user.userFollowing.map(async(val)=>{
postRef =
firestore.collection('post').where('postOwner','==',val)
await postRef.get().then(async(querySnapshot)=>{
await querySnapshot.forEach(async(doc)=>{
let list ={
...doc.data(),
postId:doc.id
}
pendingPostList.push(list)
})
})
}))
await Promise.all(pendingPostList.map(async(val)=>{
userRef =firestore.collection('user').doc(val.postOwner)
await userRef.get().then((user)=>{
let owner ={
...user.data()
}
let post={
...val,
owner:owner
}
postList.push(post)
})
}))
dispatch(_successGetPostListt(postList))
}
catch (e) {
dispatch(_failedGetPostList(e))
}
}
это мой configures
import { AsyncStorage } from "react-native";
import { composeWithDevTools } from 'redux-devtools-extension'
import { createStore, applyMiddleware, compose } from "redux";
import thunk from "redux-thunk";
import { persistStore } from "redux-persist";
import reducer from "../Reducers";
const composeEnhancers = composeWithDevTools({ realtime: true })
export default function configureStore(onCompletion: () => void): any {
const enhancer = composeEnhancers(
applyMiddleware(thunk)
);
const store = createStore(reducer, enhancer);
persistStore(store, { storage: AsyncStorage }, onCompletion);
return store;
}