@supabase/realtime-js
Advanced tools
Comparing version 1.0.5 to 1.0.6
@@ -1,5 +0,5 @@ | ||
import * as Transformers from './transformers'; | ||
export { Transformers }; | ||
export { default as Channel } from './channel'; | ||
export { default as Socket } from './socket'; | ||
import * as Transformers from './lib/transformers'; | ||
import RealtimeClient from './RealtimeClient'; | ||
import RealtimeSubscription from './RealtimeSubscription'; | ||
export { RealtimeClient, RealtimeSubscription, Transformers }; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -25,9 +25,9 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Socket = exports.Channel = exports.Transformers = void 0; | ||
const Transformers = __importStar(require("./transformers")); | ||
exports.Transformers = exports.RealtimeSubscription = exports.RealtimeClient = void 0; | ||
const Transformers = __importStar(require("./lib/transformers")); | ||
exports.Transformers = Transformers; | ||
var channel_1 = require("./channel"); | ||
Object.defineProperty(exports, "Channel", { enumerable: true, get: function () { return __importDefault(channel_1).default; } }); | ||
var socket_1 = require("./socket"); | ||
Object.defineProperty(exports, "Socket", { enumerable: true, get: function () { return __importDefault(socket_1).default; } }); | ||
const RealtimeClient_1 = __importDefault(require("./RealtimeClient")); | ||
exports.RealtimeClient = RealtimeClient_1.default; | ||
const RealtimeSubscription_1 = __importDefault(require("./RealtimeSubscription")); | ||
exports.RealtimeSubscription = RealtimeSubscription_1.default; | ||
//# sourceMappingURL=index.js.map |
@@ -1,4 +0,4 @@ | ||
import Channel from '../channel'; | ||
import RealtimeSubscription from '../RealtimeSubscription'; | ||
export default class Push { | ||
channel: Channel; | ||
channel: RealtimeSubscription; | ||
event: string; | ||
@@ -27,3 +27,3 @@ payload: any; | ||
*/ | ||
constructor(channel: Channel, event: string, payload?: any, timeout?: number); | ||
constructor(channel: RealtimeSubscription, event: string, payload?: any, timeout?: number); | ||
resend(timeout: number): void; | ||
@@ -30,0 +30,0 @@ send(): void; |
@@ -1,5 +0,5 @@ | ||
import * as Transformers from './transformers'; | ||
export { Transformers }; | ||
export { default as Channel } from './channel'; | ||
export { default as Socket } from './socket'; | ||
import * as Transformers from './lib/transformers'; | ||
import RealtimeClient from './RealtimeClient'; | ||
import RealtimeSubscription from './RealtimeSubscription'; | ||
export { RealtimeClient, RealtimeSubscription, Transformers }; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -1,5 +0,5 @@ | ||
import * as Transformers from './transformers'; | ||
export { Transformers }; | ||
export { default as Channel } from './channel'; | ||
export { default as Socket } from './socket'; | ||
import * as Transformers from './lib/transformers'; | ||
import RealtimeClient from './RealtimeClient'; | ||
import RealtimeSubscription from './RealtimeSubscription'; | ||
export { RealtimeClient, RealtimeSubscription, Transformers }; | ||
//# sourceMappingURL=index.js.map |
@@ -1,4 +0,4 @@ | ||
import Channel from '../channel'; | ||
import RealtimeSubscription from '../RealtimeSubscription'; | ||
export default class Push { | ||
channel: Channel; | ||
channel: RealtimeSubscription; | ||
event: string; | ||
@@ -27,3 +27,3 @@ payload: any; | ||
*/ | ||
constructor(channel: Channel, event: string, payload?: any, timeout?: number); | ||
constructor(channel: RealtimeSubscription, event: string, payload?: any, timeout?: number); | ||
resend(timeout: number): void; | ||
@@ -30,0 +30,0 @@ send(): void; |
{ | ||
"name": "@supabase/realtime-js", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "Listen to realtime updates to your PostgreSQL database", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -15,6 +15,6 @@ # Realtime Client | ||
```js | ||
import { Socket } from '@supabase/realtime-js' | ||
import { RealtimeClient } from '@supabase/realtime-js' | ||
var socket = new Socket(process.env.REALTIME_URL) | ||
socket.connect() | ||
var client = new RealtimeClient(process.env.REALTIME_URL) | ||
client.connect() | ||
``` | ||
@@ -25,5 +25,5 @@ | ||
```js | ||
socket.onOpen(() => console.log('Socket opened.')) | ||
socket.onClose(() => console.log('Socket closed.')) | ||
socket.onError((e) => console.log('Socket error', e.message)) | ||
client.onOpen(() => console.log('Socket opened.')) | ||
client.onClose(() => console.log('Socket closed.')) | ||
client.onError((e) => console.log('Socket error', e.message)) | ||
``` | ||
@@ -49,3 +49,3 @@ | ||
// Listen to events on the entire database. | ||
var databaseChanges = socket.channel('realtime') | ||
var databaseChanges = client.channel('realtime') | ||
databaseChanges.on('*', (e) => console.log(e)) | ||
@@ -58,3 +58,3 @@ databaseChanges.on('INSERT', (e) => console.log(e)) | ||
// Listen to events on a schema, using the format `realtime:{SCHEMA}` | ||
var publicSchema = socket.channel('realtime:public') | ||
var publicSchema = client.channel('realtime:public') | ||
publicSchema.on('*', (e) => console.log(e)) | ||
@@ -67,3 +67,3 @@ publicSchema.on('INSERT', (e) => console.log(e)) | ||
// Listen to events on a table, using the format `realtime:{SCHEMA}:{TABLE}` | ||
var usersTable = socket.channel('realtime:public:users') | ||
var usersTable = client.channel('realtime:public:users') | ||
usersTable.on('*', (e) => console.log(e)) | ||
@@ -76,3 +76,3 @@ usersTable.on('INSERT', (e) => console.log(e)) | ||
// Listen to events on a row, using the format `realtime:{SCHEMA}:{TABLE}:{COL}.eq.{VAL}` | ||
var rowChanges = socket.channel('realtime:public:users:id.eq.1') | ||
var rowChanges = client.channel('realtime:public:users:id.eq.1') | ||
rowChanges.on('*', (e) => console.log(e)) | ||
@@ -94,3 +94,3 @@ rowChanges.on('INSERT', (e) => console.log(e)) | ||
```js | ||
let { error, data } = await socket.disconnect() | ||
let { error, data } = await client.disconnect() | ||
``` | ||
@@ -97,0 +97,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
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
167259
2579
1