0.0.7 • Published 3 months ago

sharedb-jsproxy v0.0.7

Weekly downloads
-
License
ISC
Repository
github
Last release
3 months ago

sharedb-jsproxy

Javascript Proxy to ShareDB document.

Setting a value on this proxy will update the document on the backend.

Getting a value from this proxy reflects the document on the backend.

Usage

Setting and getting data

const shareDbJSProxy = new ShareDBJSProxy(shareDbDoc);

const oldValue = await shareDbJSProxy.key; // await for get operation to complete

shareDbJSProxy.key = "value";
await shareDbJSProxy.key; // await for set operation to complete

const newValue = await shareDbJSProxy.key; // await for get operation to complete

console.log({ oldValue, newValue });

Listening to changes

const shareDbJSProxy = new ShareDBJSProxy(shareDbDoc);
shareDbJSProxy.__proxy__.on('change', event => {
	debug("ShareDBJSProxy event", event);
});
0.0.5

4 months ago

0.0.4

4 months ago

0.0.7

3 months ago

0.0.6

4 months ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago