Skip to content

maxfortun/sharedb-jsproxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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);
});

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy