How to use the soya-next/redux.applyReducers function in soya-next

To help you get started, we’ve selected a few soya-next examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github traveloka / soya-next / examples / todomvc / containers / App.js View on Github external
App.propTypes = {
  todos: PropTypes.array.isRequired,
  actions: PropTypes.object.isRequired
};

const mapStateToProps = state => ({
  todos: state.todos
});

const mapDispatchToProps = dispatch => ({
  actions: bindActionCreators(TodoActions, dispatch)
});

export default compose(
  applyReducers({ todos }),
  connect(mapStateToProps, mapDispatchToProps)
)(App);
github traveloka / soya-next / examples / i18n-with-redux / components / Dictionary.js View on Github external
}
}

const mapStateToProps = (state, props) => ({
  translation: state.dictionary[generateId(props)]
});

const mapDispatchToProps = (dispatch, props) => ({
  fetchTranslation() {
    dispatch(fetchTranslation(props));
  }
});

export default compose(
  withLocale,
  applyReducers({ dictionary }),
  connect(mapStateToProps, mapDispatchToProps)
)(Dictionary);