|
Tilde Friends
|
Making apps for the impatient tilde friend.
ssb app to create yourself an SSB identityedit link from any app or new app URL/~username/app/app.jssave button or press the save hotkey (Alt+S or [browser-specific modifiers]+S)app.setDocument(html) - send HTML to the browserprint(...) - send values to the browser's developer consoleapp.localStorageGet(key) -> valueapp.localStorageSet(key, value)database(), shared_database(key), my_shared_database(package, key)db.get(key) -> valuedb.set(key, value)db.exchange(key, expected, value) -> exchangeddb.remove(key)db.getAll() -> [key1, ...]db.getLike(pattern) -> {key1: value1, ...}ssb.createIdentity() -> idssb.getIdentities() -> [id1, ...]ssb.appendMessageWithIdentity(id, content) -> message_idssb.blobStore(blob) -> blob_idssb.blobGet(id) -> blobssb.sqlAsync(query, args, row_callback)Stock helper code for calling functions across the web server and browser boundary.
import * as tfrpc from "/tfrpc.js";import * as tfrpc from "/static/tfrpc.js";tfrpc.register(function my_function() {});let promise = tfrpc.rpc.my_function();Attach App button when composing a post in the SSB app