Skip to content

Instantly share code, notes, and snippets.

@kumavis
Created January 10, 2014 20:32
Show Gist options
  • Save kumavis/8362028 to your computer and use it in GitHub Desktop.
Save kumavis/8362028 to your computer and use it in GitHub Desktop.
// -- -- -- -- on one machine -- -- -- -- --
var syncedObjectStore = new SyncedObjectStore(duplexStream)
var objA = new syncedObjectStore.Object()
var objB = new syncedObjectStore.Object()
var objC = new syncedObjectStore.Object()
objA.b = objB
objB.c = objC
// -- -- -- -- on the other machine -- -- -- --
var syncedObjectStore = new SyncedObjectStore(duplexStream)
// later we have a reference to these objects created remotely and
// we can see their references have been kept
atSomePointLater(function(objA,objB,objC){
objB.c === objC //=> true
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment