-
Notifications
You must be signed in to change notification settings - Fork 68
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
[Proposal] - Make FeedbackLoop as a struct #11
Comments
Hi @sergdort , How would we extend it? It seems to me that only way would be to expose loop lambda, but if we do that, then it's still possible to mess up. I guess this would also maybe reduce chances of error.
That would allow us to give names to most common feedback loops. |
I'm a little bit confused :) The idea is to not expose |
@sergdort yeah, I understand that, but how would somebody create an arbitrary feedback loop if needed? Don't think there is a finite number of them. |
Do you think this one is not enough? Or you think someone would want to use something else then public init(effects: @escaping (State) -> Observable<Event>) {
self.loop = { scheduler, state in
return state.flatMapLatest { state in
return effects(state).enqueue(scheduler)
}
}
} |
I don't think it's just a matter of customizing E.g. there is this form that uses a set that controls it:
I'm assuming one could potentially want It's hard to anticipate all of the possible combinations :), I'm not sure we should assume there is a finite number of them. |
Oh, I see :) Anyway, isn't the difference only in "flatting" strategy? Can't think of anything else. |
Ignore me =) I just read code snipped above one more time... |
Actually, the flattening strategy here is the same ;) |
I guess we can probably improve them in some way ... |
Hi, guys!
I've been thinking how we can improve API in a way that users won't be able to path their own
FeedbackLoop
as they may use it wrong by not usingscheduler
correctlySo here is my proposal:
By exposing only these three available initializers. I guess we can also somehow figure out how something similar can be adopted for
Driver
as well.What do you guys think?
The text was updated successfully, but these errors were encountered: