All files / src/store connect.js

100% Statements 2/2
100% Branches 1/1
100% Functions 1/1
100% Lines 2/2
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29                                              22x 22x        
/**
* Copyright 2018, Plotly, Inc.
* All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
 
import { connect } from 'react-redux';
 
import { storeKey } from './storeOptions';
 
/**
 * Injects the msaStore into a component.
 *
 * @param {Object} mapStateToProps - plain object of store state to be mapped into the component
 * @param {Object} mapDispatchToProps - methods to be mapped into the component
 * @param {Object} mergeProps - custom merge method for (stateProps, dispatchProps, ownProps)
 * @param {Object} options - further customization for the connector
 *
 * See also: https://react-redux.js.org/docs/api
 */
function msaConnect(mapStateToProps, mapDispatchToProps, mergeProps, options = {}) {
  options.storeKey = storeKey;
  return connect(mapStateToProps, mapDispatchToProps, mergeProps, options);
}
 
export default msaConnect;