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

Projects
None yet
3 participants
@mcomisso
Copy link
Contributor

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 some commits Dec 17, 2018

@albertodebortoli

This comment has been minimized.

Copy link
Owner

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link
Contributor

mcomisso commented Dec 17, 2018

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

@albertodebortoli

This comment has been minimized.

Copy link
Owner

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

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