mirror of
https://github.com/vale981/Vulcan
synced 2025-03-10 12:36:39 -04:00
25 lines
No EOL
915 B
JavaScript
25 lines
No EOL
915 B
JavaScript
import { createStore, combineReducers, applyMiddleware, compose } from 'redux';
|
|
import ApolloClient from 'apollo-client';
|
|
|
|
import Telescope from 'meteor/nova:lib';
|
|
// import { meteorClientConfig } from 'meteor/apollo';
|
|
import { client } from 'meteor/nova:base-apollo';
|
|
|
|
// // see https://github.com/apollostack/meteor-integration/blob/master/package.js#L15
|
|
// // on one hand, a client-side function shouldn't exist server-side
|
|
// // on the other hand, it breaks server-side rendering
|
|
// const config = Meteor.isClient ? meteorClientConfig() : {}; // so, that feels weird.
|
|
|
|
const rootReducer = combineReducers({...Telescope.reducers, apollo: client.reducer()});
|
|
|
|
const store = createStore(
|
|
// reducers
|
|
rootReducer,
|
|
// middlewares
|
|
compose(
|
|
applyMiddleware(client.middleware()),
|
|
typeof window !== "undefined" && window.devToolsExtension ? window.devToolsExtension() : f => f
|
|
),
|
|
);
|
|
|
|
export { store }; |