Document missing change event in browser

8 views
Skip to first unread message

Colder Xihk

unread,
Sep 25, 2014, 11:24:24 AM9/25/14
to mongoo...@googlegroups.com
Model in most front-end framework have a change event or similar way to notify UI update.
For mongoose Document. I can setup a post set hook. I can listen validate event. These works perfectly.
But I cannot spy array modify. push, pull and so on.
Since mongoose have ability handle these modify and mark dirty internal.

If we emit change event after these operation. Did it affect performance on server side without listeners?

Valeri Karpov

unread,
Sep 29, 2014, 5:40:27 PM9/29/14
to mongoo...@googlegroups.com
Hmm not sure how viable that suggestion is. That would be a lot of overhead on the server side and I want to make sure the browser component and server component are as similar as possible. I'm not so sure this is that useful, either, since many people are using stuff like Angular, which should be able to use its own dirty checking to watch for changes on a mongoose doc. Are you using anything like Angular, Knockout, etc.?

Colder Xihk

unread,
Sep 30, 2014, 5:03:12 AM9/30/14
to mongoo...@googlegroups.com
If 'overhead'. I agree with you. Let it keep current status.
I should deal with the problem in browser in browser way. Maybe observe or other method.

在 2014年9月30日星期二UTC+8上午5时40分27秒,Valeri Karpov写道:
Reply all
Reply to author
Forward
0 new messages