@liveblocks/react
Advanced tools
Comparing version
@@ -63,8 +63,5 @@ import { LiveMap, LiveList, LiveObject } from '@liveblocks/client'; | ||
const presence = room.getPresence(); | ||
const [, update] = React.useState(0); | ||
const rerender = useRerender(); | ||
React.useEffect(() => { | ||
function onMyPresenceChange() { | ||
update((x) => x + 1); | ||
} | ||
const unsubscribe = room.subscribe("my-presence", onMyPresenceChange); | ||
const unsubscribe = room.subscribe("my-presence", rerender); | ||
return () => { | ||
@@ -85,8 +82,5 @@ unsubscribe(); | ||
const room = useRoom(); | ||
const [, update] = React.useState(0); | ||
const rerender = useRerender(); | ||
React.useEffect(() => { | ||
function onOthersChange() { | ||
update((x) => x + 1); | ||
} | ||
const unsubscribe = room.subscribe("others", onOthersChange); | ||
const unsubscribe = room.subscribe("others", rerender); | ||
return () => { | ||
@@ -93,0 +87,0 @@ unsubscribe(); |
@@ -134,14 +134,5 @@ 'use strict'; | ||
var presence = room.getPresence(); | ||
var _React$useState = React__namespace.useState(0), | ||
update = _React$useState[1]; | ||
var rerender = useRerender(); | ||
React__namespace.useEffect(function () { | ||
function onMyPresenceChange() { | ||
update(function (x) { | ||
return x + 1; | ||
}); | ||
} | ||
var unsubscribe = room.subscribe("my-presence", onMyPresenceChange); | ||
var unsubscribe = room.subscribe("my-presence", rerender); | ||
return function () { | ||
@@ -164,14 +155,5 @@ unsubscribe(); | ||
var room = useRoom(); | ||
var _React$useState2 = React__namespace.useState(0), | ||
update = _React$useState2[1]; | ||
var rerender = useRerender(); | ||
React__namespace.useEffect(function () { | ||
function onOthersChange() { | ||
update(function (x) { | ||
return x + 1; | ||
}); | ||
} | ||
var unsubscribe = room.subscribe("others", onOthersChange); | ||
var unsubscribe = room.subscribe("others", rerender); | ||
return function () { | ||
@@ -245,5 +227,5 @@ unsubscribe(); | ||
var _React$useState3 = React__namespace.useState(null), | ||
root = _React$useState3[0], | ||
setState = _React$useState3[1]; | ||
var _React$useState = React__namespace.useState(null), | ||
root = _React$useState[0], | ||
setState = _React$useState[1]; | ||
@@ -250,0 +232,0 @@ React__namespace.useEffect(function () { |
{ | ||
"name": "@liveblocks/react", | ||
"version": "0.15.11-test.1", | ||
"version": "0.15.11", | ||
"description": "", | ||
@@ -36,4 +36,4 @@ "main": "./lib/index.js", | ||
"peerDependencies": { | ||
"@liveblocks/client": "0.15.11-test.1", | ||
"react": "^16.14.0 || ^17" | ||
"@liveblocks/client": "0.15.11", | ||
"react": "^16.14.0 || ^17 || ^18" | ||
}, | ||
@@ -40,0 +40,0 @@ "devDependencies": { |
<p align="center"> | ||
<a href="https://liveblocks.io"> | ||
<img src="https://liveblocks.io/images/blog/introducing-liveblocks.png"> | ||
<img src="https://raw.githubusercontent.com/liveblocks/liveblocks/main/.github/assets/header.svg" alt="Liveblocks" /> | ||
</a> | ||
</p> | ||
# Liveblocks · [](https://twitter.com/liveblocks) | ||
# `@liveblocks/react` | ||
**At [Liveblocks](https://liveblocks.io), we’re building tools to help companies create world-class collaborative products that attract, engage and retain users.** This repository is a set of open-source packages for building performant and reliable multiplayer experiences. | ||
<p> | ||
<a href="https://npmjs.org/package/@liveblocks/react"> | ||
<img src="https://img.shields.io/npm/v/@liveblocks/react?style=flat&label=npm&color=c33" alt="NPM" /> | ||
</a> | ||
<a href="https://bundlephobia.com/package/@liveblocks/react"> | ||
<img src="https://img.shields.io/bundlephobia/minzip/@liveblocks/react?style=flat&label=size&color=09f" alt="Size" /> | ||
</a> | ||
<a href="https://github.com/liveblocks/liveblocks/blob/main/LICENSE"> | ||
<img src="https://img.shields.io/github/license/liveblocks/liveblocks?style=flat&label=license&color=f80" alt="License" /> | ||
</a> | ||
</p> | ||
@@ -11,0 +21,0 @@ ## Installation |
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
51
24.39%0
-100%32988
-1.3%929
-2.52%