April 2017
Intermediate to advanced
316 pages
9h 33m
English
We will store state in our Store object:
import ReactiveSwift import ReactiveCocoa import Delta struct Store: StoreType { var state: ObservableProperty<State> init(state: State) { self.state = ObservableProperty(state) } } var store = Store(state: State())
Store conforms to the StoreType protocol declared in the Delta library. The StoreType protocol defines the storage of an observable state and dispatch methods to modify it.
Here, we create a MutableProperty as state and store it in Store object.
We need to define properties to access and modify our state properly, so we extend our Store object as follows:
import ReactiveCocoa import ReactiveSwift import Result // MARK: Properties extension Store { var todos: MutableProperty<[Todo]> ...Read now
Unlock full access