Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@liveblocks/react

Package Overview
Dependencies
Maintainers
2
Versions
419
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@liveblocks/react - npm Package Compare versions

Comparing version 0.8.0 to 0.8.2

README.md

45

lib/index.js

@@ -1267,3 +1267,3 @@ Object.defineProperty(exports, '__esModule', { value: true });

flushData: {
presence: null,
presence: me == null ? {} : me,
messages: [],

@@ -1299,4 +1299,2 @@ storageOperations: [],

/////////////
connect: machine.connect,
disconnect: machine.disconnect,
getConnectionState: machine.selectors.getConnectionState,

@@ -1326,5 +1324,9 @@ getCurrentUser: machine.selectors.getCurrentUser,

};
room._onNavigatorOnline = machine.onNavigatorOnline;
room._onVisibilityChange = machine.onVisibilityChange;
return room;
return {
connect: machine.connect,
disconnect: machine.disconnect,
onNavigatorOnline: machine.onNavigatorOnline,
onVisibilityChange: machine.onVisibilityChange,
room,
};
}

@@ -1338,2 +1340,12 @@ class LiveblocksError extends Error {

/**
* Create a client that will be responsible to communicate with liveblocks servers.
*
* ### Example
* ```
* const client = createClient({
* authEndpoint: "/api/auth"
* })
* ```
*/
function createClient(options) {

@@ -1347,13 +1359,14 @@ if (typeof options.throttle === "number") {

function getRoom(roomId) {
return rooms.get(roomId) || null;
const internalRoom = rooms.get(roomId);
return internalRoom ? internalRoom.room : null;
}
function enter(roomId, initialPresence) {
let room = rooms.get(roomId);
if (room) {
return room;
let internalRoom = rooms.get(roomId);
if (internalRoom) {
return internalRoom.room;
}
room = createRoom(roomId, Object.assign(Object.assign({}, options), { initialPresence }));
rooms.set(roomId, room);
room.connect();
return room;
internalRoom = createRoom(roomId, Object.assign(Object.assign({}, options), { initialPresence }));
rooms.set(roomId, internalRoom);
internalRoom.connect();
return internalRoom.room;
}

@@ -1371,3 +1384,3 @@ function leave(roomId) {

for (const [, room] of rooms) {
room._onNavigatorOnline();
room.onNavigatorOnline();
}

@@ -1379,3 +1392,3 @@ });

for (const [, room] of rooms) {
room._onVisibilityChange(document.visibilityState);
room.onVisibilityChange(document.visibilityState);
}

@@ -1382,0 +1395,0 @@ });

{
"name": "@liveblocks/react",
"version": "0.8.0",
"version": "0.8.2",
"description": "",

@@ -9,2 +9,12 @@ "main": "./lib/index.js",

],
"keywords": [
"react",
"liveblocks",
"multiplayer",
"live-cursors",
"collaborative"
],
"bugs": {
"url": "https://github.com/liveblocks/liveblocks/issues"
},
"scripts": {

@@ -17,3 +27,3 @@ "build": "rollup -c",

"dependencies": {
"@liveblocks/client": "0.8.0"
"@liveblocks/client": "0.8.2"
},

@@ -43,3 +53,8 @@ "peerDependencies": {

"whatwg-fetch": "^3.6.2"
},
"repository": {
"type": "git",
"url": "https://github.com/liveblocks/liveblocks.git",
"directory": "packages/liveblocks-react"
}
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc