20 lines
580 B
JavaScript
20 lines
580 B
JavaScript
import { Connector } from "./scripts/connector.js";
|
|
import { genID } from "./scripts/helpers.js";
|
|
|
|
// let thisID = localStorage.getItem('id')
|
|
// if (thisID == null) {
|
|
// thisID = genID()
|
|
// localStorage.setItem('id', thisID)
|
|
// }
|
|
|
|
let session = "uniqueSession1"
|
|
|
|
let connector = new Connector(undefined, session)
|
|
|
|
let mainObj = new connector.link();
|
|
|
|
mainObj.set({ 'frieden': 'Klaus' }) // oberste Ebene
|
|
mainObj.onchange('frieden', (change) => { console.log(change) })
|
|
|
|
mainObj.set(new connector.link('transport')); // nested object
|
|
mainObj.transport.set({ 'play': true }) |