Skip to content

Commit

Permalink
move renderContext from core to lib, so that every components/contain…
Browse files Browse the repository at this point in the history
…ers includes core’s (such as withList, App) can use renderContext.get() to get store, apolloClient, loginToken, history, reducers, middlewares
  • Loading branch information
comus committed Feb 6, 2017
1 parent b789211 commit 8a8596a
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 10 deletions.
4 changes: 0 additions & 4 deletions packages/nova-core/lib/client/main.js
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
import './auth.js';
import './mongo_redux.js';

export * from '../modules/index.js';
export * from './render_context.js';
2 changes: 1 addition & 1 deletion packages/nova-core/lib/modules/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import './callbacks.js';
// import and re-export
export {
// apollo
createApolloClient,
createApolloClient, renderContext,
// callbacks
Callbacks, addCallback, removeCallback, runCallbacks, runCallbacksAsync,
// components
Expand Down
3 changes: 0 additions & 3 deletions packages/nova-core/lib/server/main.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import './oauth.js';
import './start.js';
import './apollo_server.js';
import './meteor_subscribe.js'

export * from '../modules/index.js';
export * from './render_context.js';
File renamed without changes.
4 changes: 4 additions & 0 deletions packages/nova-lib/lib/client/main.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
import './auth.js';

export * from '../modules/index.js';
export * from './mongo_redux.js';
export * from './apollo.js';
export * from './render_context.js';
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { createStore, applyMiddleware, compose, combineReducers } from 'redux';

import { createApolloClient, addReducer, addMiddleware, getReducers, getMiddlewares } from '../modules/index.js';
import { addReducer, addMiddleware, getReducers, getMiddlewares } from '../modules/index.js';
import { createApolloClient } from './apollo.js'

const loginToken = global.localStorage['Meteor.loginToken'];
const apolloClient = createApolloClient();
Expand Down
4 changes: 4 additions & 0 deletions packages/nova-lib/lib/server/main.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import './oauth_config.js';
import './meteor_subscribe.js'

export * from '../modules/index.js';
export * from './apollo.js';
export * from './store.js';
export * from './mutations.js';
export * from './render_context.js';
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ import { WebApp } from 'meteor/webapp';
import { DDP } from 'meteor/ddp';
import { Accounts } from 'meteor/accounts-base';

import { createApolloClient, getReducers, getMiddlewares, configureStore } from '../modules/index.js';
import { getReducers, getMiddlewares } from '../modules/index.js';
import { createApolloClient } from './apollo.js';
import { configureStore } from './store.js';

const Fibers = Npm.require('fibers');

Expand Down

0 comments on commit 8a8596a

Please sign in to comment.