derbyjs / racer

Realtime model synchronization engine for Node.js
1.18k stars 117 forks source link

Dedupe queries when unbundling (_initQueries) #259

Closed ericyhwang closed 5 years ago

ericyhwang commented 5 years ago

This allows model._initQueries and by extension model.unbundle to be called multiple times, with fetch/subscribe counting incrementing appropriately each time. This matches the behavior of doc fetch/subscribe counting in model.unbundle.

Previously, new queries would be created every time _initQueries was called, which mean the fetch/subscribe counts got reset.