diff options
author | Samy Pessé <samypesse@gmail.com> | 2016-09-05 11:59:40 +0200 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2016-09-05 11:59:40 +0200 |
commit | 0e74c9bad5b184528880d499485e1154c000b1b5 (patch) | |
tree | 6628dc4ab27d6273727d6470dfcf99b11e8cdda1 /packages/gitbook-core/src/components | |
parent | d7e415b0b396639b7e5c64d61f47569b40ced053 (diff) | |
download | gitbook-0e74c9bad5b184528880d499485e1154c000b1b5.zip gitbook-0e74c9bad5b184528880d499485e1154c000b1b5.tar.gz gitbook-0e74c9bad5b184528880d499485e1154c000b1b5.tar.bz2 |
Add action to register a component
Diffstat (limited to 'packages/gitbook-core/src/components')
-rw-r--r-- | packages/gitbook-core/src/components/InjectedComponent.js | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/packages/gitbook-core/src/components/InjectedComponent.js b/packages/gitbook-core/src/components/InjectedComponent.js index fe386ef..f8e5b04 100644 --- a/packages/gitbook-core/src/components/InjectedComponent.js +++ b/packages/gitbook-core/src/components/InjectedComponent.js @@ -2,6 +2,7 @@ const React = require('react'); const connect = require('./connect'); const UnsafeComponent = require('./UnsafeComponent'); +const { findMatchingComponents } = require('../actions/components'); /* Public: InjectedComponent makes it easy to include a set of dynamically registered @@ -52,23 +53,6 @@ const InjectedComponentSet = React.createClass({ }); /** - * Find all components matching a descriptor - * @param {List<ComponentDescriptor>} components - * @param {String} matching.role - */ -function findMatchingComponents(components, matching) { - return components - .filter(({descriptor}) => { - if (matching.role && matching.role === descriptor.role) { - return false; - } - - return true; - }) - .map(component => component.Component); -} - -/** * Map Redux state to InjectedComponentSet's props */ function mapStateToProps(state, props) { |