This release is the biggest update UDF has ever had!
We've done great work in analyzing and upgrading all aspects of UDF development to provide more and more tools for fast, scalable, and independent apps building.
What was done:
- Middleware layer got huge updates. ObservableMiddleware came to replace Sync/Async middlewares, which is smarter and easier in use.
- ObservableMiddleware It has one new method
override func scope(for state: SourceOfTruth<State>) -> Scope
, the aim of which is to provide a 'scope of work'. The middleware will only observe the changes of reducers mentioned in the scope method and ignore other app state changes. The Scope method is required to be overridden in all ObservableMiddleware subclasses;
- Scope can be combined up to 5 reducers
Scopes.Combined(...);
- Also, the Middleware layer has got one new player - is ReducibleMiddleware. The main difference is that the ReducibleMiddleware is a reducer in the middleware world, that doesn't observe any flows and reduce the actions in the
open func reduce(_ action: AnyAction)
;
- The Store is getting smarter and smarter. Since 1.3.0 Store can decide to group dispatched actions, monitor State changes and control the numbers of SwiftUI Views re-rendering, middlewares calls, and can ignore some actions if State is not mutated;
- The View layer got Routing as a protocol for navigating between containers and Router class to manage navigation;
- A new action
Actions.DidCancelEffect
, that is called when the Middleware cancels an effect;
- Testing-testing-testing.
XCTestStore
it's a new Store for using only in the Unit tests, which works in sync mode and on the main thread;
And of course 100500 improvements and minor updates.
Keep Coding!
Source code(tar.gz)
Source code(zip)