Open colinmacdonald opened 10 years ago
cc: @ianlivingstone @mattcreager
error
events should also be emitted when a $set
, $add
, etc. failure occurs, currently they do not.
connect
, disconnect
, error
eventssync
alias for ready
eventadd
, set
, update
, remove
I think replacing ready
with sync
could be confusing, sync
sounds like it will trigger any time the local model is updated instead of just the initial sync. However, I do think we need an event like this to track any changes to the local model.
model.$on('syncd/changed')
Currently there are 5 events that can be listened for using model#on.
3 of these events are GoInstant key events,
add
,set
,remove
which can take anoptionsObject
and a listener:The other 2 are
ready
anderror
which do not take an options object:These inconstancies could make the method confusing because how you call the method changes based on the
eventName
you passed.Some alternative interface ideas:
Separate the key events from the local model events