diff options
Diffstat (limited to 'packages/gitbook-core/src/lib/createContext.js')
-rw-r--r-- | packages/gitbook-core/src/lib/createContext.js | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/packages/gitbook-core/src/lib/createContext.js b/packages/gitbook-core/src/lib/createContext.js index 2a826d1..c88baad 100644 --- a/packages/gitbook-core/src/lib/createContext.js +++ b/packages/gitbook-core/src/lib/createContext.js @@ -66,15 +66,17 @@ function createContext(plugins, initialState) { Redux.compose(Redux.applyMiddleware(thunk)) ); - // Initialize the plugins - plugins.forEach(plugin => { - plugin.init(store.dispatch, store.getState, actions); - }); - - return new Context({ + // Create the context + const context = new Context({ store, + plugins, actions }); + + // Initialize the plugins + context.activate(); + + return context; } module.exports = createContext; |