summaryrefslogtreecommitdiffstats
path: root/packages/gitbook-plugin-search/src/index.js
blob: c3b02531598c3bb6bfb4f5b1180f0161f199ff19 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
const GitBook = require('gitbook-core');

const SearchInput = require('./components/Input');
const SearchResults = require('./components/Results');
const reducers = require('./reducers');
const search = require('./actions/search');

module.exports = GitBook.createPlugin({
    init: (dispatch, getState) => {
        dispatch(GitBook.registerComponent(SearchInput, { role: 'search:input' }));
        dispatch(GitBook.registerComponent(SearchResults, { role: 'search:results' }));
    },
    reduce: reducers,
    actions: {
        search
    }
});