The markdown parsing is broken/disabled for release notes. Sorry about that, I'm chasing the source of a crash that's been bringing this website down for the last couple of days.
- Rename `combine(reducers:)` to `combined(reducers:)`
- Update to Swift 5
Add Compatibility for Swift 3.0.1 and its Package Manager
7 years ago
**No functionality or API changes**
Action is a Protocol and combine(reducers:)
7 years ago
## Breaking change
#### Made `Action` a `protocol` rather than a `typealias` of `Any`
Because if `Action` were a `typealias` of `Any`, then `dispatch(_: Action/Any)` could also dispatch AsyncActions
#### Renamed `combineReducers(_:)` to `combine(reducers:)`
### What is needed to update from version 1 to 2?
**Not much.**
After you got the new release, `v2.0.0`
- Try compile your project with it
- Fix complier error where your `Action` types need to conform to `Action`
- Fix compiler error where there's `combineReducers(_:)`
### Benefits
Safer code. For example, without this change, you could dispatch `AsyncAction` with `dispatch(_:Action)` method which won't have any expected effect.
## Changelog
- Rename `combineReducers` to `combine(reducers:)` 3d52400
- Make Action a protocol rather than a typealias of Any 7403e06
- Everything is `final` by default after [SE-0117] 9d2a45b
Lemme know if there **is** a change
7 years ago
**BUT NOT THE CHANGE**
## What's new?
- Now you can subscribe to changes of a _Store_'s _State_ without caring what's the change
## What's changed?
- Mark all `func`s in Store as `final`
Dispatching Async Actions
7 years ago
``` swift
// fetchPosts: AsycAction
func fetchPosts(dispatch: @escaping Store.Dispatch) {
dispatch(Actions.fetchPosts(.start))
api.fetchPosts { posts: [Post] in
dispatch(Actions.fetchPosts(.success(posts: posts)))
}
}
store.dispatch(asyncAction : fetchPosts)
```
Two More `subscribe` methods!
7 years ago
## What's new?
Add two more `subscribe` methods to subscribe to the changes of a store's state
1. A `subscribe` method takes a function which takes a `State` rather than a `Store` (considered safer)
2. A `subscribe` method takes a `Converter` (converts `State` to `SpecificState`) and a function takes a `SpecificState`
## What's changed?
### Fix Doc for jazzy and CocoaPods
Things wrapped in `* *` were missing if they were in `parameter` or a `returns`,
e.g.
```
- parameter reducer: A *Reducer* function
```
will be rendered as:
> reducer: A function
Document Everything!
7 years ago
## What's new?
Added document for everything.
`import TDRedux` if installed with CocoaPods
7 years ago
## What's changed?
Fix issue if framework is installed with CocoaPods where you have to `import TDRedux_swift`.
Now you can do just this:
``` swift
import TDRedux
```
Support for Swift Package Manager and CocoaPods!
7 years ago
## What's new?
Added support for Swift Package Manager and CocoaPods!
## NB
If you are installing TDRedux 1.4.0 with CocoaPods, you need to use `TDRedux_swift` as its module name. For example:
``` swift
import TDRedux_swift
```
**If you'd like to import this framework as `TDRedux`, use next version `1.4.1`.**