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

Generics implementation #1

Merged
merged 2 commits into from Dec 17, 2018

Conversation

@mcomisso
Copy link
Contributor

@mcomisso mcomisso commented Dec 17, 2018

I bet there is a reason behind it, so it's JUSTanidea. But I think this small change helps keeping everything together by avoiding all those rawValues and having to go through state changes with strings.
Just consider swapping a state with an event, spelling them wrong, etc..

Anyway, thanks for the cool code!

mcomisso added 2 commits Dec 17, 2018
@albertodebortoli
Copy link
Owner

@albertodebortoli albertodebortoli commented Dec 17, 2018

Thanks a lot @mcomisso! I was talking about this with @MarcoSantarossa yesterday who was proposing to avoid rawValue with (I believe) a very similar solution! Using generics is definitely a good idea, I didn't get that far as I stopped after a simple brainless conversion of ADBStateMachine to Swift.
Will review soon.

@MarcoSantarossa
Copy link

@MarcoSantarossa MarcoSantarossa commented Dec 17, 2018

Yep, my idea was similar but actually I was proposing to use a generic which conforms to RawRepresentable but this solution is better since you can use an even more generic enum. Nice idea also the type alias 👍

@mcomisso
Copy link
Contributor Author

@mcomisso mcomisso commented Dec 17, 2018

Thanks!
Glad I have contributed with something that was already on the todo list 😄 👍

@albertodebortoli
Copy link
Owner

@albertodebortoli albertodebortoli commented Dec 17, 2018

This PR is golden 👏👏👏
Thank you so much @mcomisso 🙏

@albertodebortoli albertodebortoli merged commit d1e60e8 into albertodebortoli:master Dec 17, 2018
1 check passed
1 check passed
ci/bitrise/5b1bed7dfe1521fd/pr Passed - Stateful
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants