Skip to content

Instantly share code, notes, and snippets.

@Darep
Last active December 14, 2015 18:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Darep/5128457 to your computer and use it in GitHub Desktop.
Save Darep/5128457 to your computer and use it in GitHub Desktop.
buildData: function () {
var newData, data = api.getSongs();
// Fix paths
var transformPath = this.transformPath.bind(this);
newData = data.map(function (row) {
row.path = transformSongPath(row.path);
return row;
});
this.data = newData;
},
transformPath: function (path) {
// ... some simple string transformations ...
}
@Darep
Copy link
Author

Darep commented Aug 27, 2013

Looking for ways to refactor this. How can I make this look nicer and simpler?

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