chore(combobox): Update Redux example
This commit is contained in:
Родитель
e7ac396142
Коммит
caa2efcd28
|
@ -1,5 +1,5 @@
|
|||
export function onChange(data) {
|
||||
return { type: "CHANGE", value: data };
|
||||
export function onChange(value) {
|
||||
return { type: "CHANGE", value: value };
|
||||
}
|
||||
|
||||
export function onFilter(data) {
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
const constants = {
|
||||
INIT: "@@INIT",
|
||||
CHANGE: "CHANGE",
|
||||
SELECT: "SELECT",
|
||||
FILTER: "FILTER",
|
||||
|
|
|
@ -15,7 +15,7 @@ const propTypes = {
|
|||
export class ComboBoxContainer extends React.Component {
|
||||
render() {
|
||||
return (
|
||||
<ComboBoxContainer {...this.props} />
|
||||
<StatefulComboBox {...this.props} />
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -35,4 +35,4 @@ const mapDispatchToProps = function(dispatch) {
|
|||
};
|
||||
};
|
||||
|
||||
export const ComboBoxDataContainer = ReactRedux.connect(mapStateToProps, mapDispatchToProps)(StatefulComboBox);
|
||||
export const ComboBoxDataContainer = ReactRedux.connect(mapStateToProps, mapDispatchToProps)(ComboBoxContainer);
|
|
@ -19,6 +19,8 @@ export function getData(state, action) {
|
|||
switch (action.type) {
|
||||
case ACTIONS.FILTER:
|
||||
return filterData(action.query, initialState().complexItems);
|
||||
case ACTIONS.CHANGE:
|
||||
return state;
|
||||
}
|
||||
return initialState().complexItems;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче