You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					24 lines
				
				883 B
			
		
		
			
		
	
	
					24 lines
				
				883 B
			| 
								 
											3 years ago
										 
									 | 
							
								"use strict";
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								exports.__esModule = true;
							 | 
						||
| 
								 | 
							
								exports.default = verifySubselectors;
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								var _warning = _interopRequireDefault(require("../utils/warning"));
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								function verify(selector, methodName) {
							 | 
						||
| 
								 | 
							
								  if (!selector) {
							 | 
						||
| 
								 | 
							
								    throw new Error(`Unexpected value for ${methodName} in connect.`);
							 | 
						||
| 
								 | 
							
								  } else if (methodName === 'mapStateToProps' || methodName === 'mapDispatchToProps') {
							 | 
						||
| 
								 | 
							
								    if (!Object.prototype.hasOwnProperty.call(selector, 'dependsOnOwnProps')) {
							 | 
						||
| 
								 | 
							
								      (0, _warning.default)(`The selector for ${methodName} of connect did not specify a value for dependsOnOwnProps.`);
							 | 
						||
| 
								 | 
							
								    }
							 | 
						||
| 
								 | 
							
								  }
							 | 
						||
| 
								 | 
							
								}
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								function verifySubselectors(mapStateToProps, mapDispatchToProps, mergeProps) {
							 | 
						||
| 
								 | 
							
								  verify(mapStateToProps, 'mapStateToProps');
							 | 
						||
| 
								 | 
							
								  verify(mapDispatchToProps, 'mapDispatchToProps');
							 | 
						||
| 
								 | 
							
								  verify(mergeProps, 'mergeProps');
							 | 
						||
| 
								 | 
							
								}
							 |