@telestack/db-sdk 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +4 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -428,7 +428,10 @@ export class Query {
428
428
  if (!centrifuge)
429
429
  return () => { };
430
430
  const channel = `collection:${this.path.replace(/\//g, '_')}`;
431
- const sub = centrifuge.newSubscription(channel);
431
+ let sub = centrifuge.getSubscription(channel);
432
+ if (!sub) {
433
+ sub = centrifuge.newSubscription(channel);
434
+ }
432
435
  const debouncedCallback = () => {
433
436
  if (this.debounceTimer)
434
437
  clearTimeout(this.debounceTimer);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@telestack/db-sdk",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Fluent, real-time SDK for Telestack DB",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",