You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All sbot methods are called from within a callback from ssb-client.
I can call them from a function by passing the sbot object to it like so: (simplified)
var ssbClient = require('ssb-client')
function publishMessage(sbot, message,recipients) {
sbot.private.publish(message,recipients,callback)
}
ssbClient(function (err, sbot) {
publishMessage(sbot,'hello',{ alice, bob })
} )
But when i have a function called from elsewhere, for example an onclick="function()" event in the html, i have no opportunity to pass the sbot object to the function and so sbot's methods are out of scope.
I am wondering if i can get around this by wrapping ssb-client around electron's loadURL:
const electron = require('electron')
const app = electron.app
const BrowserWindow = electron.BrowserWindow
function createWindow () {
mainWindow = new BrowserWindow({width: 800, height: 600})
// put this inside ssb-clients callback?
mainWindow.loadURL(`file://${__dirname}/../html/index.html`)
}
app.on('ready', createWindow)
but still there isnt a way to pass on the sbot object. Any ideas?
The text was updated successfully, but these errors were encountered:
All sbot methods are called from within a callback from ssb-client.
I can call them from a function by passing the sbot object to it like so: (simplified)
But when i have a function called from elsewhere, for example an onclick="function()" event in the html, i have no opportunity to pass the sbot object to the function and so sbot's methods are out of scope.
I am wondering if i can get around this by wrapping ssb-client around electron's loadURL:
but still there isnt a way to pass on the sbot object. Any ideas?
The text was updated successfully, but these errors were encountered: