diff --git a/client/coral-embed-stream/src/containers/StreamTabPanel.js b/client/coral-embed-stream/src/containers/StreamTabPanel.js index 9a154512d..d3dadb5d2 100644 --- a/client/coral-embed-stream/src/containers/StreamTabPanel.js +++ b/client/coral-embed-stream/src/containers/StreamTabPanel.js @@ -1,7 +1,6 @@ import React from 'react'; import StreamTabPanel from '../components/StreamTabPanel'; import {connect} from 'react-redux'; -import omit from 'lodash/omit'; import {Tab, TabPane} from 'coral-ui'; import {getShallowChanges} from 'coral-framework/utils'; import isEqual from 'lodash/isEqual'; @@ -106,7 +105,7 @@ StreamTabPanelContainer.propTypes = { }; const mapStateToProps = (state) => ({ - reduxState: omit(state, 'apollo'), + reduxState: state, }); export default connect(mapStateToProps, null)(StreamTabPanelContainer); diff --git a/client/coral-framework/components/IfSlotIsEmpty.js b/client/coral-framework/components/IfSlotIsEmpty.js index 51a849448..8470fadba 100644 --- a/client/coral-framework/components/IfSlotIsEmpty.js +++ b/client/coral-framework/components/IfSlotIsEmpty.js @@ -1,7 +1,6 @@ import React, {Children} from 'react'; import {connect} from 'react-redux'; import PropTypes from 'prop-types'; -import omit from 'lodash/omit'; import {getShallowChanges} from 'coral-framework/utils'; class IfSlotIsEmpty extends React.Component { @@ -39,7 +38,7 @@ IfSlotIsEmpty.propTypes = { }; const mapStateToProps = (state) => ({ - reduxState: omit(state, 'apollo'), + reduxState: state, }); export default connect(mapStateToProps, null)(IfSlotIsEmpty); diff --git a/client/coral-framework/components/IfSlotIsNotEmpty.js b/client/coral-framework/components/IfSlotIsNotEmpty.js index 6186e2166..a498ad3aa 100644 --- a/client/coral-framework/components/IfSlotIsNotEmpty.js +++ b/client/coral-framework/components/IfSlotIsNotEmpty.js @@ -1,7 +1,6 @@ import React, {Children} from 'react'; import {connect} from 'react-redux'; import PropTypes from 'prop-types'; -import omit from 'lodash/omit'; import {getShallowChanges} from 'coral-framework/utils'; class IfSlotIsNotEmpty extends React.Component { @@ -39,7 +38,7 @@ IfSlotIsNotEmpty.propTypes = { }; const mapStateToProps = (state) => ({ - reduxState: omit(state, 'apollo'), + reduxState: state, }); export default connect(mapStateToProps, null)(IfSlotIsNotEmpty); diff --git a/client/coral-framework/components/Slot.js b/client/coral-framework/components/Slot.js index e1acd82f4..0404df80f 100644 --- a/client/coral-framework/components/Slot.js +++ b/client/coral-framework/components/Slot.js @@ -2,7 +2,6 @@ import React from 'react'; import cn from 'classnames'; import styles from './Slot.css'; import {connect} from 'react-redux'; -import omit from 'lodash/omit'; import kebabCase from 'lodash/kebabCase'; import PropTypes from 'prop-types'; import isEqual from 'lodash/isEqual'; @@ -121,7 +120,7 @@ Slot.propTypes = { }; const mapStateToProps = (state) => ({ - reduxState: omit(state, 'apollo'), + reduxState: state, }); export default connect(mapStateToProps, null)(Slot); diff --git a/client/coral-framework/components/TalkProvider.js b/client/coral-framework/components/TalkProvider.js index 418bb3760..880b4c9d9 100644 --- a/client/coral-framework/components/TalkProvider.js +++ b/client/coral-framework/components/TalkProvider.js @@ -13,13 +13,14 @@ class TalkProvider extends React.Component { notification: this.props.notification, storage: this.props.storage, history: this.props.history, + store: this.props.store, }; } render() { - const {children, client, store} = this.props; + const {children, client} = this.props; return ( - + {children} ); @@ -35,6 +36,7 @@ TalkProvider.childContextTypes = { notification: PropTypes.object, storage: PropTypes.object, history: PropTypes.object, + store: PropTypes.object, }; export default TalkProvider; diff --git a/client/coral-framework/services/bootstrap.js b/client/coral-framework/services/bootstrap.js index 85144fe60..9862ff23c 100644 --- a/client/coral-framework/services/bootstrap.js +++ b/client/coral-framework/services/bootstrap.js @@ -159,21 +159,28 @@ export async function createContext({ pym.sendMessage('event', JSON.stringify({eventName, value})); }); + // Create our redux store. const finalReducers = { ...reducers, ...plugins.getReducers(), - apollo: client.reducer(), }; store = createStore(finalReducers, [ - client.middleware(), thunk.withExtraArgument(context), - apolloErrorReporter, createReduxEmitter(eventEmitter), ]); context.store = store; + // Create apollo redux store. + context.apolloStore = createStore({ + apollo: client.reducer(), + }, [ + client.middleware(), + apolloErrorReporter, + createReduxEmitter(eventEmitter), + ]); + // Run pre initialization. if (preInit) { await preInit(context);