diff options
author | Samy Pesse <samypesse@gmail.com> | 2016-10-03 14:56:55 +0200 |
---|---|---|
committer | Samy Pesse <samypesse@gmail.com> | 2016-10-03 14:56:55 +0200 |
commit | d82032298dcbfc5c1a6d011a5afe72af9e21ab42 (patch) | |
tree | 8c8197be2527f1f3c0f72bc1a4ef711e26241622 /packages/gitbook-core/src/lib/createContext.js | |
parent | 34eb35699d951783837faf026a60abadc888a010 (diff) | |
download | gitbook-d82032298dcbfc5c1a6d011a5afe72af9e21ab42.zip gitbook-d82032298dcbfc5c1a6d011a5afe72af9e21ab42.tar.gz gitbook-d82032298dcbfc5c1a6d011a5afe72af9e21ab42.tar.bz2 |
Fix new api for activate/deactivate
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; |