@telestack/db-sdk 1.0.3 → 1.0.4

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
@@ -501,7 +501,10 @@ export class Query {
501
501
  if (!centrifuge)
502
502
  return () => { };
503
503
  const channel = `collection:${this.path.replace(/\//g, '_')}`;
504
- const sub = centrifuge.newSubscription(channel);
504
+ let sub = centrifuge.getSubscription(channel);
505
+ if (!sub) {
506
+ sub = centrifuge.newSubscription(channel);
507
+ }
505
508
  sub.on('join', (ctx) => {
506
509
  callback({ action: 'join', user: ctx.info.user, clientId: ctx.info.client });
507
510
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@telestack/db-sdk",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "Fluent, real-time SDK for Telestack DB",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",