mirror of
				https://github.com/datahub-project/datahub.git
				synced 2025-10-31 18:59:23 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			21 lines
		
	
	
		
			668 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			21 lines
		
	
	
		
			668 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| import Ember from 'ember';
 | |
| import connect from 'ember-redux/components/connect';
 | |
| 
 | |
| const { Component } = Ember;
 | |
| const entities = ['datasets', 'metrics', 'flows']; // hardcoded here to maintain the sort order
 | |
| /**
 | |
|  * Selector function that takes a Redux Store to extract
 | |
|  *   state props for the browser-view
 | |
|  * @param {Object} browseData
 | |
|  * @return {Object}
 | |
|  */
 | |
| const stateToComputed = ({ browse: { browseData = {} } = {} }) => ({
 | |
|   browseData: entities.map(browseDatum =>
 | |
|     Object.assign(
 | |
|       { entity: browseDatum }, // assigns key name to resulting object
 | |
|       browseData[browseDatum]
 | |
|     )
 | |
|   )
 | |
| });
 | |
| export default connect(stateToComputed)(Component.extend({}));
 | 
