Last active
          August 29, 2015 14:27 
        
      - 
      
 - 
        
Save adamrneary/5346605c481ffaf98e21 to your computer and use it in GitHub Desktop.  
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | module.exports = function(model) { | |
| const entity = model.entity; | |
| let apiActions = {}; | |
| // This method can be used in situations where a model's data is fetched via | |
| // a separate request, and we just want to process the resulting data | |
| apiActions.receiveAll = function(result) { | |
| Flux.dispatch(actionTypes.API_FETCH_SUCCESS, { | |
| model: model, | |
| result: result, | |
| }); | |
| return result; | |
| }; | |
| // and so on… | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment