Skip to content

Instantly share code, notes, and snippets.

@KoryNunn
Last active September 28, 2016 07:02
Show Gist options
  • Select an option

  • Save KoryNunn/41298d8704ceb827ff6c69b95bfc8863 to your computer and use it in GitHub Desktop.

Select an option

Save KoryNunn/41298d8704ceb827ff6c69b95bfc8863 to your computer and use it in GitHub Desktop.
// Assumes <Thing>.get is a normal err-back API.
var json = righto.from(xmltojsonhttpclient.get()),
transform = righto(SearchModel.get, json),
mappedData = righto(SearchController.get, transform),
contractData = righto(ContractModel.get, mappedData),
mappedContractData = righto(ContractController.get, contractData);
mappedContractData(function(error, result){
// Do what you want.
});
@KoryNunn
Copy link
Author

KoryNunn commented Sep 28, 2016

I'm assuming the .get() calls in the original return promises, and I'm thinking there may be a case that can be added to righto that handles tasks that return promises or rightos, but that will be based on future requirements.

EDIT: Meh, I added it: https://gist.github.com/KoryNunn/999c5578ef2144986d3bcb4f2ae246d0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment