Book Image

Build Applications with Meteor

Book Image

Build Applications with Meteor

Overview of this book

This book starts with the basic installation and overview of the main components in Meteor. You’ll get hands-on multiple versatile applications covering a wide range of topics from adding a front-end views with the hottest rendering technology React to implementing a microservices oriented architecture.All the code is written with ES6/7 which is the latest significantly improved JavaScript language. We’ll also look at real-time data streaming, server to server data exchange, responsive styles on the front-end, full-text search functionality, and integration of many third-party libraries and APIs using npm. By the end of the book, you’ll have the skills to quickly prototype and even launch your next app idea in a matter of days.
Table of Contents (16 chapters)
Title Page
Credits
About the Author
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface
8
Build a Chatbot with Facebook’s Messenger Platform

Connecting the Redux store with the React components


Throughout the book, we have been splitting the components into presentational and container components. There are a few things that we can do with Redux by following that pattern.

The presentational components will not be aware of Redux, and their main job is to present the UI. All markup and CSS classes will be defined in the presentational components. On the other hand, the containers will take care of the data and will barely contain any markup. The main difference is that we will have Redux to generate the containers for us.

Redux is not a React library, and we can get the bindings from the react-redux library:

import {connect} from 'react-redux'
class Tweets extends React.Component {
  ...
}

const mapStateToProps = (state) => ({tweets: state.tweets, filters: state.filters})
export default connect(mapStateToProps)(Tweets)

Here's how it works:

  • We imported the connect method from react-redux and mapped the global state values with the...