You are reading content from Scuttlebutt
@mix %4oBJxdSCHGnwGh9EOfssTFhqe0ftbAwRsOQdBgHjFmQ=.sha256
Re: %7kkZ8kEGz

you could have a stab at an idea and share it, or go check out scuttle-poll or scuttle-blog.

basically there's an instantiation with an sbot instance (mine is fancy because it takes sbot or an sbot.obs.connection ... which is patchcore's observeable connection which reconnects if it breaks)

usage would look like :

var ScuttleTag = require('scuttle-tag')

var tag = ScuttleTag(sbot)
// var tag ScuttleTag(api.sbout.obs.connection)  // in patchcore land

tag.get(id)
tag.create(options)  // I am making up api now... D:

The way I implemented this was to make each of your api methods a closure :

function (sbot) {
  return function get (id) {
    // ... 
  }
}

Then I have a function (inject) which ties it all together so you can use it as in the first example.

very fast brain dump right before I go to sleep! - read my code and ask questions or we can do a call sometime if you like.

Join Scuttlebutt now