This commit is contained in:
18
node_modules/react-redux/es/connect/mapDispatchToProps.js
generated
vendored
Normal file
18
node_modules/react-redux/es/connect/mapDispatchToProps.js
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
import bindActionCreators from '../utils/bindActionCreators';
|
||||
import { wrapMapToPropsConstant, wrapMapToPropsFunc } from './wrapMapToProps';
|
||||
export function whenMapDispatchToPropsIsFunction(mapDispatchToProps) {
|
||||
return typeof mapDispatchToProps === 'function' ? wrapMapToPropsFunc(mapDispatchToProps, 'mapDispatchToProps') : undefined;
|
||||
}
|
||||
export function whenMapDispatchToPropsIsMissing(mapDispatchToProps) {
|
||||
return !mapDispatchToProps ? wrapMapToPropsConstant(function (dispatch) {
|
||||
return {
|
||||
dispatch: dispatch
|
||||
};
|
||||
}) : undefined;
|
||||
}
|
||||
export function whenMapDispatchToPropsIsObject(mapDispatchToProps) {
|
||||
return mapDispatchToProps && typeof mapDispatchToProps === 'object' ? wrapMapToPropsConstant(function (dispatch) {
|
||||
return bindActionCreators(mapDispatchToProps, dispatch);
|
||||
}) : undefined;
|
||||
}
|
||||
export default [whenMapDispatchToPropsIsFunction, whenMapDispatchToPropsIsMissing, whenMapDispatchToPropsIsObject];
|
||||
Reference in New Issue
Block a user