如何使用reactotron-redux与easy-peasy?

ldfqzlk8  于 2022-11-12  发布在  React
关注(0)|答案(1)|浏览(115)
/* eslint-disable import/no-cycle */
import {action, createStore} from 'easy-peasy';
import reactotron from 'reactotron-react-native';
import {applyMiddleware, compose} from 'redux';
import drawerModal from '../models/drawerModal';

let initialState = {};

const store = createStore(
  {
    drawerModal,
    reset: action(() => ({
      ...initialState,
    })),
  },
  {name: 'easystore', compose: applyMiddleware([reactotron.createEnhancer()])}
);

initialState = store.getState();
export default store;

我试过了,但是没有用

prdp8dxp

prdp8dxp1#

更新日期:2022年8月29日,其工作方式如下

配置文件ReactotronConfig.js

import Reactotron from 'reactotron-react-native';
import { reactotronRedux } from 'reactotron-redux'

const reactron= Reactotron.configure({
  name: 'My App',
  host: '192.168.1.9',
})
  .useReactNative({
    storybook: true,
    asyncStorage: false, // there are more options to the async storage.
    networking: {
      // optionally, you can turn it off with false.
      ignoreUrls: /symbolicate/,
    },
    editor: false, // there are more options to editor
    overlay: false, // just turning off overlay
  })
  .use(reactotronRedux()) 
  .connect();

  export default reactron

使用store.js中文件

import {action, createStore} from 'easy-peasy';

import exploredMovies from './models/exploredMovies';
import reactron from '../helpers/ReactotronConfig';

let initialState = {};
window.requestIdleCallback = null;
const store = createStore(
  {

    exploredMovies,
    reset: action(() => ({
      ...initialState,
    })),
  },
  {name: 'easystore', enhancers: [reactron.createEnhancer()]}
);

initialState = store.getState();
export default store;

===========================================

二〇二二年七月十二日

我与机构群体进行了讨论,但未获得支持

相关问题