Composable unidirectional data flow with ReactiveSwift.
This is the first stable release of Loop 2.0. It requires Swift 5.2, and supports CocoaPods, Carthage and Swift Package Manager (tools version 5.2).
Introduce Loop
, a thread-safe implementation as the source of truth for your unidirectional data flows.
It is renamed from the v1.0 FeedbackLoop
, and merged with features from the experimental compositional Store
. Note that Loop
now starts as it is initialised — start()
and stop()
previously provided by FeedbackLoop
are now no-op and are officially deprecated.
Loop
now provides two new feedback variants:
whenBecomesTrue(_:effects:)
Given a predicate over the loop state, it spawns an effect with a snapshot of the state, when a positive edge is observed from the the predicate output. It automatically cancels any outstanding effect if a negative edge is observed.
firstValueAfterNil(_:effects:)
Given a transform over the loop state, it spawns an effect with the first non-nil value from the transform output. It automatically cancels any outstanding effect if any nil
is observed.
The aforementioned feedback variants are intended to replace predicate:
as a standard offering in Loop.
We believe that the new variants provide more specialised semantics for the purpose of application development. Most importantly, from the production experience of Loop observed, we are confident that these are more flexible defaults to adapt to the variety in state modelling complexity (e.g., from sum type FSM, to product of sums).
You can now create scoped loops through Loop.scoped
to create lens of your root loop for injecting into different areas of your application.
The scheduler-bound loop API — instantiated via Property.init
or SignalProducer.system
— has been deprecated since Loop 1.0. They may be removed in the next major release.
This is the third beta release of Loop 2.0. It requires Swift 5.2, and supports CocoaPods, Carthage and Swift Package Manager (tools version 5.2).
See the release note for Loop 2.0 beta 1 for important changes in 2.0.
firstValueAfterNil
not starting the effect, when the the supplied (State) -> U?
transform does yield non-nil value for the initial state. (#22)whenBecomesTrue
not starting the effect, when the the supplied (State) -> Bool
predicate does pass with the initial state. (#22)Loop.send(_:)
should work but deadlock instead. (#23)This is the second beta release of Loop 2.0. It requires Swift 5.2, and supports CocoaPods, Carthage and Swift Package Manager (tools version 5.2).
See the release note for Loop 2.0 beta 1 for important changes in 2.0.
This is the first beta release of Loop 2.0. It requires Swift 5.2, and supports CocoaPods, Carthage and Swift Package Manager (tools version 5.2).
Introduce Loop
, a thread-safe implementation as the source of truth for your unidirectional data flows.
It is renamed from the v1.0 FeedbackLoop
, and merged with features from the experimental compositional Store
. Note that Loop
now starts as it is initialised — start()
and stop()
previously provided by FeedbackLoop
are now no-op and are officially deprecated.
Loop
now provides two new feedback variants:
whenBecomesTrue(_:effects:)
Given a predicate over the loop state, it spawns an effect with a snapshot of the state, when a positive edge is observed from the the predicate output. It automatically cancels any outstanding effect if a negative edge is observed.
firstValueAfterNil(_:effects:)
Given a transform over the loop state, it spawns an effect with the first non-nil value from the transform output. It automatically cancels any outstanding effect if any nil
is observed.
The aforementioned feedback variants are intended to replace predicate:
as a standard offering in Loop.
We believe that the new variants provide more specialised semantics for the purpose of application development. Most importantly, from the production experience of Loop observed, we are confident that these are more flexible defaults to adapt to the variety in state modelling complexity (e.g., from sum type FSM, to product of sums).
You can now create scoped loops through Loop.scoped
to create lens of your root loop for injecting into different areas of your application.
The scheduler-bound loop API — instantiated via Property.init
or SignalProducer.system
— has been deprecated since Loop 1.0. They may be removed in the next major release.
The community fork of ReactiveFeedback has been renamed to ReactiveCocoa Loop.
Snippets for updating your dependency declarations:
// Package.swift
.package(url: "https://github.com/ReactiveCocoa/Loop", from: "1.0.0")
// Cartfile
github "ReactiveCocoa/Loop" ~> 1.0
// Podfile
pod "Loop", "~> 1.0"
Fixed a race condition in the new synchronous FeedbackLoop
.
https://github.com/babylonhealth/ReactiveFeedback/pull/58
Fixed a bug in the async Property
feedback loop API, causing the reducer not runnig the specified Scheduler
.
https://github.com/babylonhealth/ReactiveFeedback/pull/57/
Experimental support for feedback & reducer composition. https://github.com/babylonhealth/ReactiveFeedback/pull/49