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

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

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

Loading…
Cancel
Save