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

Turn Slack map into struct #57

Closed
BlakeWilliams opened this issue Apr 29, 2016 · 7 comments
Closed

Turn Slack map into struct #57

BlakeWilliams opened this issue Apr 29, 2016 · 7 comments

Comments

@BlakeWilliams
Copy link
Owner

The "slack" state is currently a map but would be better as a struct so it can be better documented and functions that manipulate/interact with it can be separated from the rest of the code.

@christhekeele
Copy link
Contributor

Was thinking about taking on a couple of these issues. For this one, do you want to turn Slack itself into a struct, or put it somewhere else to avoid cluttering the macro-ful module, like Slack.Conn?

@christhekeele
Copy link
Contributor

Also, how do you feel other structs, like Slack.Message, Slack.User. Slack.Channel, etc?

@BlakeWilliams
Copy link
Owner Author

I would move the Slack state first, but it would probably be in its own module. I was initially thinking Slack.State but could be convinced of other names.

I think once that's done it'll make sense to re-evaluate the idea of Slack.Message, user, etc.

@christhekeele
Copy link
Contributor

christhekeele commented May 12, 2016

Both Slack.Struct and Slack.State seem a little nondescript, but I can't think of a great alternative. Slack.API is kind of inaccurate. Slack.Conn and Slack.Client work better, but kind of already occupy a space in the domain model (websocket conn + client).

@christhekeele
Copy link
Contributor

Alternatively, flip it around such that the state is a %Slack{} struct and library gets consumed with use Slack.API (or Slack.Behaviour, Slack.Client)

@christhekeele
Copy link
Contributor

christhekeele commented May 13, 2016

Slack.State feels pretty weird because all the callbacks end up with a Slack.State and a user-defined state right next to each other in the params.

@BlakeWilliams
Copy link
Owner Author

I don't think it's too weird. 'Slack.Client' isn't bad either.

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

Successfully merging a pull request may close this issue.

2 participants