diff options
Diffstat (limited to 'packages/gitbook-core/src/lib')
-rw-r--r-- | packages/gitbook-core/src/lib/createContext.js | 3 | ||||
-rw-r--r-- | packages/gitbook-core/src/lib/renderWithContext.js | 3 |
2 files changed, 5 insertions, 1 deletions
diff --git a/packages/gitbook-core/src/lib/createContext.js b/packages/gitbook-core/src/lib/createContext.js index ba0c7e1..d4e1fca 100644 --- a/packages/gitbook-core/src/lib/createContext.js +++ b/packages/gitbook-core/src/lib/createContext.js @@ -8,6 +8,7 @@ const coreReducers = require('../reducers'); const composeReducer = require('./composeReducer'); const Components = require('../actions/components'); +const Api = require('../actions/api'); const I18n = require('../actions/i18n'); const History = require('../actions/history'); @@ -21,7 +22,7 @@ const isBrowser = (typeof window !== 'undefined'); const corePlugin = new Plugin({ reduce: coreReducers, actions: { - Components, I18n, History + Components, I18n, History, Api } }); diff --git a/packages/gitbook-core/src/lib/renderWithContext.js b/packages/gitbook-core/src/lib/renderWithContext.js index 70fba5c..480cfef 100644 --- a/packages/gitbook-core/src/lib/renderWithContext.js +++ b/packages/gitbook-core/src/lib/renderWithContext.js @@ -5,6 +5,7 @@ const PJAXWrapper = require('../components/PJAXWrapper'); const I18nProvider = require('../components/I18nProvider'); const ContextProvider = require('../components/ContextProvider'); const History = require('../actions/history'); +const Api = require('../actions/api'); const contextShape = require('../propTypes/Context'); const GitBookApplication = React.createClass({ @@ -16,11 +17,13 @@ const GitBookApplication = React.createClass({ componentDidMount() { const { context } = this.props; context.dispatch(History.activate()); + context.dispatch(Api.activate()); }, componentWillUnmount() { const { context } = this.props; context.dispatch(History.deactivate()); + context.dispatch(Api.deactivate()); }, render() { |