@@ -49,10 +49,10 @@ val presenterEnhancer: StoreEnhancer = { storeCreator: StoreCreator ->
4949 * Attaching sets the presenter to the view.
5050 * PresenterFactory subscribes to changes in state, and passes state to presenters.
5151 */
52- fun < S : Any , V : ViewWithProvider > presenterMiddleware (uiContext : CoroutineContext ): Middleware = { store ->
52+ fun presenterMiddleware (uiContext : CoroutineContext ): Middleware = { store ->
5353
5454 val uiScope = CoroutineScope (uiContext)
55- val subscribers = mutableMapOf<V , StoreSubscriberHolder >()
55+ val subscribers = mutableMapOf<ViewWithProvider , StoreSubscriberHolder >()
5656 var subscription: StoreSubscription ? = null
5757 val coroutineScope = CoroutineScope (uiContext)
5858
@@ -68,7 +68,7 @@ fun <S : Any, V : ViewWithProvider> presenterMiddleware(uiContext: CoroutineCont
6868 }
6969 }
7070
71- fun attachView (view : V ) {
71+ fun attachView (view : ViewWithProvider ) {
7272 Logger .d(" AttachView: $view " , Logger .Category .LIFECYCLE )
7373// view.dispatch = store.dispatch
7474 // TODO is hanging onto subscription needed?
@@ -88,7 +88,7 @@ fun <S : Any, V : ViewWithProvider> presenterMiddleware(uiContext: CoroutineCont
8888 }
8989 }
9090
91- fun detachView (view : V ) {
91+ fun detachView (view : ViewWithProvider ) {
9292 Logger .d(" DetachView: $view " , Logger .Category .LIFECYCLE )
9393 subscribers[view] = StoreSubscriberHolder (ViewLifecycle .DETACHED , subscribers[view]!! .subscriber)
9494 }
@@ -106,11 +106,11 @@ fun <S : Any, V : ViewWithProvider> presenterMiddleware(uiContext: CoroutineCont
106106 { next: Dispatcher ->
107107 { action: Any ->
108108 when (action) {
109- is AttachView -> attachView(action.view as V )
109+ is AttachView -> attachView(action.view as ViewWithProvider )
110110
111- is DetachView -> detachView(action.view as V )
111+ is DetachView -> detachView(action.view as ViewWithProvider )
112112
113- is ClearView -> clearView(action.view as V )
113+ is ClearView -> clearView(action.view as ViewWithProvider )
114114
115115 else -> next(action)
116116 }
0 commit comments