value-sync

1.0.2 • Public • Published



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]". 

Readme

Keywords

none

Package Sidebar

Install

npm i value-sync

Weekly Downloads

3

Version

1.0.2

License

MIT

Last publish

Collaborators

  • egorgl