-
Notifications
You must be signed in to change notification settings - Fork 7
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
Merge Store
and FeedbackLoop
API. Rename it to Loop
.
#7
Conversation
public init( | ||
initial: State, | ||
reducer: @escaping (inout State, Event) -> Void, | ||
feedbacks: [Loop<State, Event>.Feedback] |
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.
Should we just remove old feedback and have Feedback<State, Event>
, I find it quite annoying to have API
static func whenSomething() -> Loop<State, Event>. Feedback
vs
static func whenSomething() -> Feedback<State, Event>
¯_(ツ)_/¯
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'd prefer to leave the gradual migration option on the table.
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.
Alternatively, we can rename the old feedback to something else, so manual migration is required.
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.
@sergdort lets do that in a separate PR, no?
@sergdort misconfiguration 🤦 |
This PR merges
Store
andFeedbackLoop
into one API.API renames
FeedbackLoop
andStore
is renamed toLoop
.Store.view(value:event:)
is renamed toLoop.scoped(to:event:)
.FeedbackLoop.init(initial:reduce:feedbacks:)
is renamed toLoop.init(initial:reducer:feedbacks:)
.Removed API
FeedbackLoop.start()
andFeedbackLoop.stop()
are now unavailable.Store.state
is now unavailable. It is replaced byLoop.context
, which is a producer yieldingContext<S, E>
.Implementation
Loop
does type erasure by inheritance internally, so that it can be the currency type for both root loops (global stores) & their scoped views (local derived stores).This also hides stuff like
start()
andstop()
from the public API, that were intended forSignalProducer.feedbackLoop
.