derbyjs / racer

Realtime model synchronization engine for Node.js
1.19k stars 118 forks source link

model.subscribe problems #75

Closed VanCoding closed 11 years ago

VanCoding commented 11 years ago

Hi guys

I'm doing some tests with derby and having some problems with model.subscribe. I've posted it on stackoverflow: http://stackoverflow.com/questions/14211408/derby-automatic-refresh-on-changes

Why does the callback passed to model.subscribe not get called after defining a new post using model.set('posts.'+model.id(),{text:'mytext'}) ?

Is this a bug or intended?

VanCoding commented 11 years ago

Oh, I got it to work after doing model.ref("_posts",posts) and then iterating doing {#each _posts} in the template.

So, the model.subscribe callback really should be called only once. No bug :)