@talend/react-containers
Version:
Provide connected components aka containers for @talend/react-cmf based on @talend/react-components.
29 lines (27 loc) • 857 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getComponentState = getComponentState;
exports.getQuery = getQuery;
var _FilterBar = require("./FilterBar.container");
/**
* Selector on the state from the filter id given.
* @param {object} state
* @param {string} idComponent
*/
function getComponentState(state, idComponent) {
if (state.cmf.components.hasIn([_FilterBar.DISPLAY_NAME, idComponent])) {
return state.cmf.components.getIn([_FilterBar.DISPLAY_NAME, idComponent]);
}
return _FilterBar.DEFAULT_STATE;
}
/**
* Return the filterInputValue attr from the state of filter id given.
* @param {object} state
* @param {string} idComponent
*/
function getQuery(state, idComponent) {
return getComponentState(state, idComponent).get('query', '');
}
//# sourceMappingURL=FilterBar.selectors.js.map