mean-expert-official / loopback-component-realtime

The LoopBack Component that turns this great framework into a powerful real-time platform
MIT License
30 stars 17 forks source link

No broadcast when an object is deleted #24

Closed mike-packetwerk closed 7 years ago

mike-packetwerk commented 7 years ago

In https://github.com/mean-expert-official/loopback-component-realtime/blob/master/src/modules/FireLoop.ts#L493 the value broadcast only occurs if ctx.data exists.

I would expect if I have a FireLoopRef.on('value') I get notified whenever a model instance is changed, created or deleted.

Seems to me that FireLoop.broadcast(ctx, 'value'); should be moved up 2 lines.

What do you think?

mike-packetwerk commented 7 years ago

Hmm, seems like I missed the 'change' event. It does what I'm asking above.