document.currentScript.className = 'visible'
import {background} from 'util'
// change the background of a page
background('#08f')
text('hello')
html(`
<h1>HELLO</h1>
<h2>World</h2>
`)
css(`
h1 {color: red}
`)
Local storage (backed by localforage), shared between other clients.
All values are cast to String, and limited to 60 characters
import {setItem, getItem, getItems, subItem, subItems} from 'store'
// store a key
setItem('name', 'ben')
// get a key
setItem('name')
.then(n => console.log("hi, " + n))
// get all (remote) values
getItems('name')
.then(names => console.log("hi, " + names.join(', '))
// subscribe to a local key
subItem('name', (n) => {
console.log(n)
})
// subscribe to remote keys
subItems('name', (names) => {
console.log(names)
})
import {subscribe} from 'messaging'
subscribe('dial', value => console.log(value) )
subscribe('a', value => console.log(value) )
subscribe('b', value => console.log(value) )