Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

events for managing cabals #86

Open
khubo opened this issue Dec 17, 2021 · 1 comment
Open

events for managing cabals #86

khubo opened this issue Dec 17, 2021 · 1 comment

Comments

@khubo
Copy link
Member

khubo commented Dec 17, 2021

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:

  • joining cabal
  • creating cabal
  • leaving cabal
@cblgh
Copy link
Member

cblgh commented Dec 20, 2021

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:


yeah i like it, i think :) how do you feel about those three additional events?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants