Skip to content

Commit

Permalink
removed explicit null dispatcher
Browse files Browse the repository at this point in the history
  • Loading branch information
beyondeye authored and daely committed Sep 25, 2016
1 parent 8e8fcc7 commit 539da74
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ class KovenantStore<S>(initialState: S, private var reducer: IReducer<S>, val ob
* An action can be of Any type
*/
override var dispatch: (action: Any) -> Any = { action ->
mainDispatcher.dispatch(this, nullDispatcher, action)
mainDispatcher.dispatch(this,
{ it -> it}, //null dispatcher that ends the chain
action)
}

override fun subscribe(storeSubscriber: IStoreSubscriber<S>): IStoreSubscription {
Expand All @@ -102,7 +104,5 @@ class KovenantStore<S>(initialState: S, private var reducer: IReducer<S>, val ob
}
}
}

val nullDispatcher : (Any)->Any= { it -> it}
}

5 changes: 3 additions & 2 deletions reduks/src/main/kotlin/com/beyondeye/reduks/SimpleStore.kt
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ class SimpleStore<S>(initialState: S, private var reducer: IReducer<S>) : Store<
* An action can be of Any type
*/
override var dispatch: (action: Any) -> Any = { action ->
mainDispatcher.dispatch(this, nullDispatcher,action )
mainDispatcher.dispatch(this,
{it->it}, //null dispatcher that ends the chain
action )
}

override fun subscribe(storeSubscriber: IStoreSubscriber<S>): IStoreSubscription {
Expand All @@ -49,6 +51,5 @@ class SimpleStore<S>(initialState: S, private var reducer: IReducer<S>) : Store<
}
}
}
val nullDispatcher : (Any)->Any= {it->it}
}

0 comments on commit 539da74

Please sign in to comment.