Skip to content

Commit

Permalink
Remove scheduler from public initializer
Browse files Browse the repository at this point in the history
  • Loading branch information
reloni committed Mar 2, 2017
1 parent e5f183c commit b404747
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions RxDataFlow/RxDataFlowController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,30 @@ public final class RxDataFlowController<State: RxStateType> : RxDataFlowControll

let bag = DisposeBag()
let reducer: RxReducerType
let scheduler: ImmediateSchedulerType
let scheduler: ImmediateSchedulerType

var stateStack: FixedStack<(setBy: RxActionType, state: State)>
var actionsQueue = Queue<RxActionType>()
var isActionExecuting = BehaviorSubject(value: false)

let currentStateSubject: BehaviorSubject<(setBy: RxActionType, state: State)>
let errorsSubject = PublishSubject<(state: State, action: RxActionType, error: Error)>()

public convenience init(reducer: RxReducerType,
initialState: State,
maxHistoryItems: UInt = 50,
dispatchAction: RxActionType? = nil) {
self.init(reducer: reducer,
initialState: initialState,
maxHistoryItems: maxHistoryItems,
scheduler: SerialDispatchQueueScheduler(qos: .utility, internalSerialQueueName: "RxStore.DispatchQueue"),
dispatchAction: dispatchAction)
}

public init(reducer: RxReducerType,
init(reducer: RxReducerType,
initialState: State,
maxHistoryItems: UInt = 50,
scheduler: ImmediateSchedulerType = SerialDispatchQueueScheduler(qos: .utility, internalSerialQueueName: "RxStore.DispatchQueue"),
scheduler: ImmediateSchedulerType,
dispatchAction: RxActionType? = nil) {
self.scheduler = scheduler
self.reducer = reducer
Expand Down

0 comments on commit b404747

Please sign in to comment.