Skip to content

Instantly share code, notes, and snippets.

@julianjelfs
Created August 11, 2015 12:09
Show Gist options
  • Select an option

  • Save julianjelfs/fc21c471b5e182769c54 to your computer and use it in GitHub Desktop.

Select an option

Save julianjelfs/fc21c471b5e182769c54 to your computer and use it in GitHub Desktop.
$http.get('url').then(notifications => {
return _.map(notifications, n => {
let templates = {
1 : `/desktop/${n.Name}/${n.SomeId}`,
2 : `/desktop/${n.Whatever}/${n.SomethingElse}`
};
return {
text : n.Text,
route : templates[n.Type]
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment