1.0.2 • Published 6 years ago

value-sync v1.0.2

Weekly downloads
1
License
MIT
Repository
-
Last release
6 years ago

Better docs coming soon!

Example?

CoffeeScript example:

sync = require 'value-sync'

# Let's create our objects.
foo = {}
bar = {}
baz = {}

# And bind them together!
portal = new sync.VPortal ([
	[foo, 'ham']
	[bar, 'spam']
	[baz, 'eggs'] ])

foo.ham = 100

console.log "#{foo.ham}, #{bar.spam}, #{baz.eggs}" # will print "100, 100, 100".

# Now desynchronize them!
portal.desync()

foo.ham = 10
bar.spam = 'Do dolor esse tempor'
baz.eggs = { x: 50 }

console.log "#{foo.ham}, #{bar.spam}, #{baz.eggs}" # will print "10, Do dolor esse tempor., [object Object]".