Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Imagine you could share user data with JavaScript right in the browser. How would the code look like? This is what I came up with. Forks & comments much appreciated! (see also: #nobackend #dreamcode
// add a new share
share = new Share()
// grant / revoke access
share.revomeWriteAccess(['', ''])
// add all todo objects to the share
// remove a specific todo from the share
store.find('todo', '123').then(share.remove)
// remove objects from all shares
// remove share
// open a share and load all its objects
share = new Share('shareIdHere')
share.findAll().done( render )
// subscribe: sync changes between local store and remote share

This comment has been minimized.

Copy link

@aishwar aishwar commented Nov 15, 2013

This looks cool. I am curious how would shares work. Would a share just be an object that contains pointers to data objects? Or would the actual data object be copied into the share?


This comment has been minimized.

Copy link

@zerotacg zerotacg commented Dec 14, 2014

in a talk [1] someone from hoodie mentioned that they share the data using filtered replication of couchdb



This comment has been minimized.

Copy link
Owner Author

@gr2m gr2m commented Jan 19, 2015

I've updated the code to be generic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment