Skip to content

Instantly share code, notes, and snippets.

@andresgcarmona
Created August 27, 2018 15:30
Show Gist options
  • Save andresgcarmona/218ae17e87a8d76bbcb2eb9a507adf60 to your computer and use it in GitHub Desktop.
Save andresgcarmona/218ae17e87a8d76bbcb2eb9a507adf60 to your computer and use it in GitHub Desktop.
Todos collection
import {Collection} from 'backbone';
import TodoModel from 'models/todos/todo';
class TodosCollection extends Collection {
constructor(options) {
super(options);
this.model = TodoModel;
this.page = 1;
this.numResults = 10;
this.on('all', function(e) {
});
}
get url() {
return '/todos/lists';
}
parse(response) {
if(response.data) {
return response.data;
}
return response;
}
}
export default TodosCollection;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment