Last active
          September 22, 2016 21:17 
        
      - 
      
- 
        Save ahume/6e9a4eaa3fd6854122c4b65c1bc81352 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
    
  
  
    
  | const extendObj = | |
| R.curry((key, valueCreator, obj) => Object.assign({}, obj, { [key]: valueCreator(obj) })); | |
| // e.g. | |
| fetch(url).then(results => results.json()) | |
| .then( | |
| R.map(extendObj('deployment_id', () => deploymentId))) | |
| .then( | |
| R.map(extendObj('friendly_created_at', r => moment(r.created_at).format('YYYY-MM-DD HH:mm')))) | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment