Created
August 27, 2018 15:30
-
-
Save andresgcarmona/218ae17e87a8d76bbcb2eb9a507adf60 to your computer and use it in GitHub Desktop.
Todos collection
This file contains 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
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