Open khubo opened 2 years ago
thanks for making an issue on this @khubo!
just gonna brainstorm a bit
so we have the client object typically, e.g.
const Client = require("cabal-client")
const client = new Client({/* opts */})
// which is e.g. used to create a cabal
client.createCabal().then(/* more stuff */)
so i guess this proposal would look something like
client.on("leave", ({ key /* anything else? */}) => /* do stuff in the on-leave */)
client.on("join", ({ key }) => ) // currently covered by cb here https://github.com/cabal-club/cabal-client/blob/master/src/client.js#L169
client.on("create" ({ key }) => ) // also covered by cb here https://github.com/cabal-club/cabal-client/blob/master/src/client.js#L169
some other interesting events at the client level:
"removed"
: cabal has been removed https://github.com/cabal-club/cabal-client/blob/master/src/client.js#L267
"init"
: the initialization init
event, after which performing actions on the cabal is safe"focus"
: the currently focused cabal (e.g. the active cabal, the one you are chatting in atm) has been switch from one to another https://github.com/cabal-club/cabal-client/blob/master/src/client.js#L250 yeah i like it, i think :) how do you feel about those three additional events?
Currently all events are at cabal level, and there is no events emitted for adding/joining/removing cabal etc. It would be dope if we could have some events for the same at client level. Events on top of my head is: