-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modella 0.2 support and ajaxParseAllBody and ajaxParseGetBody events #8
Conversation
Modella 0.2 support and ajaxParseAllBody and ajaxParseGetBody events
@alexmingoia you rock dude! I'm going to try and do mongo tonight or tomorrow and ship 0.2.0 later this week. |
Nice! What about some event hooks for saving/updating/deleting? It's possible that reusing the @rschmukler You mentioned a plugin writing guide here: modella/modella#21 (comment) Is that still in the works? |
@scttnlsn Hooks for saving and deleting are not specific to the ajax sync module, they are provided by modella core. See: |
@scttnlsn Yeah, it is. Sorry, I've been working on something else these last few days (which I'll be releasing tonight, if all goes well!) but then I will. @alexmingoia I think @scttnlsn is saying that having something like having |
@rschmukler Awesome! And yes, that's what I was imagining...something to parse the responses from PUT and POSTs to the resource. |
Agreed we need better event coverage. I propose emitting the event Example User.on('ajax get response', function(res) {
res.body.registeredAt = new Date(res.body.registeredAt);
});
User.on('ajax all response', function(res) {
var users = res.body.results;
// Convert JSON string dates into actual dates
users.forEach(u) {
u.registeredAt = new Date(u.registeredAt);
}
res.body = users;
});
User.on('ajax removeAll response', function(res) {
// ..
});
User.on('ajax save response', function(res) {
// ..
});
User.on('ajax update response', function(res) {
// ..
});
User.on('ajax remove response', function(res) {
// ..
}); I have time to do this tomorrow afternoon. Thoughts? |
@alexmingoia What do you think about dropping the |
@rschmukler Sounds good. I'm fine with that. |
Awesome. If you have time to do it that's awesome. I'm going to try for modella-mongo tomorrow. Today was dedicated to agenda. |
+1 on the shorter event names |
Modella 0.2 support and
ajaxParseAllBody
andajaxParseGetBody
events. Closes modella/ajax/7.