-
Notifications
You must be signed in to change notification settings - Fork 14
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
Adding simple examples to README.md #268
base: master
Are you sure you want to change the base?
Conversation
a32add9
to
0130ff7
Compare
JaCoCo Code Coverage 80.64% ✅
Generated by 🚫 Danger |
val decrementButton: Button = ... | ||
|
||
// We convert Formula instance to RxJava observable. | ||
val counterOutput: Observable<CounterFormula.Output> = CounterFormula().toObservable() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we can show the example without using RxJava. Possible? Or maybe this should switch to Flow
, might be more familiar to Android devs now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added Flow
example as well
0130ff7
to
2fff920
Compare
RxAction.fromObservable { repository.getCounterState() }.onEvent { currentCount -> | ||
val newState = state.copy(currentCount = currentCount) | ||
transition(newState) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a way to use Flow here as well yet? I don't think we support it yet, but if we do, maybe we could add that example too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, though I'm not yet sure how to best incorporate in in examples as there is RxJava as well. I will think about it more
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What
I'm adding simple, but full examples to README.md. The goal is to show how Formula looks without getting too deep into details and best practices.