Browse Source

Remove drizzle and breeze context

develop
Apostolos Fanakis 4 years ago
parent
commit
207ce0e281
  1. 12
      packages/concordia-app/src/index.jsx
  2. 10
      packages/concordia-app/src/redux/store.js

12
packages/concordia-app/src/index.jsx

@ -1,24 +1,14 @@
import './utils/wdyr';
import React, { Suspense } from 'react';
import { render } from 'react-dom';
import { Drizzle } from '@ezerous/drizzle';
import { Breeze } from '@ezerous/breeze';
import App from './App';
import store from './redux/store';
import AppContext from './components/AppContext';
import drizzleOptions from './options/drizzleOptions';
import breezeOptions from './options/breezeOptions';
import * as serviceWorker from './utils/serviceWorker';
import LoadingScreen from './components/LoadingScreen';
const drizzle = new Drizzle(drizzleOptions, store);
const breeze = new Breeze(breezeOptions, store);
render(
<Suspense fallback={<LoadingScreen />}>
<AppContext.Provider drizzle={drizzle} breeze={breeze}>
<App store={store} />
</AppContext.Provider>
<App store={store} />
</Suspense>,
document.getElementById('root'),
);

10
packages/concordia-app/src/redux/store.js

@ -1,11 +1,14 @@
import { configureStore, getDefaultMiddleware } from '@reduxjs/toolkit';
import { drizzleReducers, drizzleMiddlewares, generateContractsInitialState } from '@ezerous/drizzle';
import { breezeReducers } from '@ezerous/breeze';
import {
drizzleReducers, drizzleMiddlewares, generateContractsInitialState, Drizzle,
} from '@ezerous/drizzle';
import { Breeze, breezeReducers } from '@ezerous/breeze';
import createSagaMiddleware from 'redux-saga';
import userReducer from './reducers/userReducer';
import rootSaga from './sagas/rootSaga';
import drizzleOptions from '../options/drizzleOptions';
import peerDbReplicationReducer from './reducers/peerDbReplicationReducer';
import breezeOptions from '../options/breezeOptions';
const initialState = {
contracts: generateContractsInitialState(drizzleOptions),
@ -24,5 +27,8 @@ const store = configureStore({
preloadedState: initialState,
});
export const drizzle = new Drizzle(drizzleOptions, store);
export const breeze = new Breeze(breezeOptions, store);
sagaMiddleware.run(rootSaga);
export default store;

Loading…
Cancel
Save