lib/createMastermind.js
function mapStateToProps(state) {

				// initialize return object
				var mappedState = {};

				// populate return object
				keys.forEach(function (key) {

					// add selector connection
					if (key.split(':').length === 2 && selectors[key.split(':')[1]]) {
						mappedState[key.split(':')[0]] = selectors[key.split(':')[1]](state);

						// add branch connection
					} else if (state[key]) {
						mappedState[key] = state[key].toJS();
					}
				});

				return shouldReturnAFunction ? function (state, props) {
					return mappedState;
				} : mappedState;
			}
function mapStateToProps(state) {

				// initialize return object
				var mappedState = {};

				// populate return object
				keys.forEach(function (key) {

					// add selector connection
					if (key.split(':').length === 2 && selectors[key.split(':')[1]]) {
						mappedState[key.split(':')[0]] = selectors[key.split(':')[1]](state);

						// add branch connection
					} else if (state[key]) {
						mappedState[key] = state[key].toJS();
					}
				});

				return shouldReturnAFunction ? function (state, props) {
					return mappedState;
				} : mappedState;
			}
function mapStateToProps ( state ) { // initialize return object var mappedState = { } ; // populate return object keys . forEach ( function ( key ) { // add selector connection if ( key . split ( ':' ) . length === 2 && selectors [ key . split ( ':' ) [ 1 ] ] ) { mappedState [ key . split ( ':' ) [ 0 ] ] = selectors [ key . split ( ':' ) [ 1 ] ] ( state ) ; // add branch connection } else if ( state [ key ] ) { mappedState [ key ] = state [ key ] . toJS ( ) ; } } ) ; return shouldReturnAFunction ? function ( state , props ) { return mappedState ; } : mappedState ; }
function that maps store state to component props
function that maps store state to component props