Events for persistence.add

63 views
Skip to first unread message

Guido Lorenz

unread,
Feb 23, 2012, 3:03:48 AM2/23/12
to persistence.js
Hi,

in a previous thread (http://groups.google.com/group/persistencejs/t/
369858a7508dcab3) Zef mentioned that no events are triggered when a
new entity is added using persistence.add(). On the other hand, when I
remove an entity using persistence.remove(), a 'change' event is
triggered.

Since add events would be very helpful for me, I wrote a
persistence.objectAdded function very similar to the existing
persistence.objectRemoved. It seems to work like a charm, but I
started wondering why it wasn't part of persistence.js already, given
that it seems quite simple to implement.

So my question is: What is the reason for the current behavior? Are
there any pitfalls I'm not aware of when triggering events for
persistence.add?

Cheers,
Guido

Zef Hemel

unread,
Feb 23, 2012, 12:19:25 PM2/23/12
to persis...@googlegroups.com
There's no event triggered when using persistence.add? There should be, at least on the EntityName.all() query collection. If that doesn't happen I'm not sure why not. Feel free to fork and send me a pull request to put that in.


-- Zef

Reply all
Reply to author
Forward
0 new messages