You are reading content from Scuttlebutt
User has not chosen to be hosted publicly
@mix %4oBJxdSCHGnwGh9EOfssTFhqe0ftbAwRsOQdBgHjFmQ=.sha256

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.

User has not chosen to be hosted publicly
@mix %UUW36at9pybBfYLPdP16FumiVFC1o5jlvYINyGdc+kw=.sha256

Hey @Josiah reviewing this, it looks pretty clearly laid out. One of the main changes that you've made to the logic is coupling this to patchcore, which is what I was keen to avoid. The pattern I'm keen on is being able to take just the server - you can use the server to get those needs you wanted fairly straightforwardly - publish is just straight up a method on server, and you can look at the content of sbot.pull.stream to get the same behaviour but I'm pretty sure it's using a standard method on sbot.

My other major suggestion is that I think the html should not live in this module. The intention of this module is to make get and manipulating tag data easy for any devs in any client (that's my goal that I'm projecting). Experiene suggests the html part should be really handled by each client. e.g. I notice here you've got about.obs.name. Patchless doesn't have that at all, so your view that uses this is not general enough to be useful for that client. I'm still exploring how to do views in a way that's useful across clients. My latest work on maybe more modular views is in patchbay-poll, where my views are as 'dumb' as possible and then I dependency inject things like name, which in the patchbay context could be about.obs.name but anyone can put whatever function they want in there.

I've proposed a call time in PM, if we can confirm that I'll invite @matt as well (Matt we need to be more organised and follow through!)

I'll make a couple of notes on github and open a PR.
I highly recommend adding tests, it will add a lot to your sanity. scuttle-poll has some good examples of testing in this space IMO

@mix %Zg1x8KTZZoKv7i7dJIG1wg7VDRBVpG8PSkbJ4QZaE74=.sha256

oof https://github.com/wittjosiah/scuttle-tag/pull/1

User has not chosen to be hosted publicly
User has not chosen to be hosted publicly
@mix %zv2jfJDm8o0l6QeOjM/z/lsvxQZEExPYOexwU+xM6P4=.sha256

I've been meaning to write a scuttlebutt-testing repo which is a guide.
Let me know if you have any questions in that direction atm

Join Scuttlebutt now