@supabase/realtime-js
Advanced tools
Comparing version 1.5.1 to 1.6.0
@@ -1,2 +0,2 @@ | ||
export declare const version = "1.5.1"; | ||
export declare const version = "1.6.0"; | ||
//# sourceMappingURL=version.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.version = void 0; | ||
exports.version = '1.5.1'; | ||
exports.version = '1.6.0'; | ||
//# sourceMappingURL=version.js.map |
@@ -70,2 +70,18 @@ "use strict"; | ||
else { | ||
const configs = this.bindings.reduce((acc, binding) => { | ||
const { type } = binding; | ||
if (![ | ||
'phx_close', | ||
'phx_error', | ||
'phx_reply', | ||
'presence_diff', | ||
'presence_state', | ||
].includes(type)) { | ||
acc[type] = binding; | ||
} | ||
return acc; | ||
}, {}); | ||
if (Object.keys(configs).length) { | ||
this.updateJoinPayload({ configs }); | ||
} | ||
this.joinedOnce = true; | ||
@@ -183,5 +199,5 @@ this.rejoin(timeout); | ||
const push = this.push(payload.type, payload); | ||
return new Promise((resolve) => { | ||
return new Promise((resolve, reject) => { | ||
push.receive('ok', () => resolve('ok')); | ||
push.receive('timeout', () => resolve('timeout')); | ||
push.receive('timeout', () => reject('timeout')); | ||
}); | ||
@@ -188,0 +204,0 @@ } |
@@ -1,2 +0,2 @@ | ||
export declare const version = "1.5.1"; | ||
export declare const version = "1.6.0"; | ||
//# sourceMappingURL=version.d.ts.map |
@@ -1,2 +0,2 @@ | ||
export const version = '1.5.1'; | ||
export const version = '1.6.0'; | ||
//# sourceMappingURL=version.js.map |
@@ -65,2 +65,18 @@ import isEqual from 'lodash.isequal'; | ||
else { | ||
const configs = this.bindings.reduce((acc, binding) => { | ||
const { type } = binding; | ||
if (![ | ||
'phx_close', | ||
'phx_error', | ||
'phx_reply', | ||
'presence_diff', | ||
'presence_state', | ||
].includes(type)) { | ||
acc[type] = binding; | ||
} | ||
return acc; | ||
}, {}); | ||
if (Object.keys(configs).length) { | ||
this.updateJoinPayload({ configs }); | ||
} | ||
this.joinedOnce = true; | ||
@@ -178,5 +194,5 @@ this.rejoin(timeout); | ||
const push = this.push(payload.type, payload); | ||
return new Promise((resolve) => { | ||
return new Promise((resolve, reject) => { | ||
push.receive('ok', () => resolve('ok')); | ||
push.receive('timeout', () => resolve('timeout')); | ||
push.receive('timeout', () => reject('timeout')); | ||
}); | ||
@@ -183,0 +199,0 @@ } |
{ | ||
"name": "@supabase/realtime-js", | ||
"version": "1.5.1", | ||
"version": "1.6.0", | ||
"description": "Listen to realtime updates to your PostgreSQL database", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -1,1 +0,1 @@ | ||
export const version = '1.5.1' | ||
export const version = '1.6.0' |
@@ -83,2 +83,25 @@ import isEqual from 'lodash.isequal' | ||
} else { | ||
const configs = this.bindings.reduce( | ||
(acc, binding: { [key: string]: any }) => { | ||
const { type } = binding | ||
if ( | ||
![ | ||
'phx_close', | ||
'phx_error', | ||
'phx_reply', | ||
'presence_diff', | ||
'presence_state', | ||
].includes(type) | ||
) { | ||
acc[type] = binding | ||
} | ||
return acc | ||
}, | ||
{} | ||
) | ||
if (Object.keys(configs).length) { | ||
this.updateJoinPayload({ configs }) | ||
} | ||
this.joinedOnce = true | ||
@@ -215,5 +238,5 @@ this.rejoin(timeout) | ||
return new Promise((resolve) => { | ||
return new Promise((resolve, reject) => { | ||
push.receive('ok', () => resolve('ok')) | ||
push.receive('timeout', () => resolve('timeout')) | ||
push.receive('timeout', () => reject('timeout')) | ||
}) | ||
@@ -220,0 +243,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
316790
5648