Skip to content

Commit

Permalink
Added default value for middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
StevenLambion committed Aug 30, 2019
1 parent d0d0c76 commit 358f53e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/SwiftDux/Store/Store.swift
Expand Up @@ -21,7 +21,7 @@ public final class Store<State> where State : StateType {
/// - state: The initial state of the store. A typically use case is to restore a previous application session with a persisted state object.
/// - reducer: A reducer that will mutate the store's state as actions are dispatched to it.
/// - middleware: One or more middleware plugins
public init<R>(state: State, reducer: R, middleware: [Middleware<State>]) where R : Reducer, R.State == State {
public init<R>(state: State, reducer: R, middleware: [Middleware<State>] = []) where R : Reducer, R.State == State {
let storeReducer = StoreReducer(reducer)
self.state = state
self.reduceAction = middleware.reversed().reduce(
Expand Down

0 comments on commit 358f53e

Please sign in to comment.