Skip to content

Commit 05531fb

Browse files
author
Patrick Jackson
committed
clean up
1 parent b460b1e commit 05531fb

File tree

2 files changed

+1
-88
lines changed

2 files changed

+1
-88
lines changed
Lines changed: 0 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
package com.willowtreeapps.common.external
22

3-
import com.willowtreeapps.common.AbstractSelector
4-
import com.willowtreeapps.common.AppState
5-
import com.willowtreeapps.common.Selector
6-
import com.willowtreeapps.common.SelectorBuilder
73
import org.reduxkotlin.Store
84
import org.reduxkotlin.StoreSubscriber
9-
import kotlin.reflect.KProperty1
105

116
typealias Presenter<View> = (View) -> (Store) -> StoreSubscriber
127
/**
@@ -83,54 +78,6 @@ fun <State : Any, V: View<State>> SelectorSubscriberFn(store: Store, view: V, se
8378
}
8479
}
8580

86-
87-
typealias SelectorSubscriber<State, View> = SelectorSubscriberBuilder<State>.() -> View.() -> Unit
88-
89-
//typealias SelectorSubscriberB<State, View> = View.() -> (SelectorSubscriberBuilder<State, View>.() -> Unit)
90-
//typealias SelectorSubscriberC<State, View> = View.() -> (Store) -> (SelectorSubscriberBuilder<State, View>.() -> Unit)
91-
//typealias SelectorSubscriberD<State, View> = View.() -> (Store) -> StoreSubscriber
92-
//
93-
typealias MySelectorSubscriber<View> = SelectorSubscriber<AppState, View>
94-
95-
//experimental selector using KProps
96-
operator fun KProperty1<AppState, Boolean>.get(pos: Int) {
97-
98-
}
99-
100-
/*
101-
val searchPresenterSubscriber: MySelectorSubscriber<SearchView> =
102-
{
103-
{
104-
plus { AppState::isLoadingItems[0] } + { showLoading() }
105-
plus { it.isLoadingItems } + { showLoading() }
106-
withSingleField({ it.isLoadingItems }) { showLoading() }
107-
}
108-
}
109-
110-
val searchPresenterSubscriberB: SelectorSubscriberB<AppState, SearchView> = {
111-
{
112-
plus { AppState::isLoadingItems[0] } + { showLoading() }
113-
plus { it.isLoadingItems } + { showLoading() }
114-
}
115-
}
116-
117-
118-
val searchPresenterSubscriberC: SelectorSubscriberC<AppState, SearchView> = {
119-
{ store ->
120-
{
121-
plus { AppState::isLoadingItems[0] } + { showLoading() }
122-
plus { it.isLoadingItems } + { showLoading() }
123-
}
124-
}
125-
}
126-
127-
128-
fun <State : Any > selectFun(store: Store, actions: (SelectorSubscriberBuilder<State, View>.() -> Unit)): StoreSubscriber {
129-
val sel = SelectorSubscriberFn<State, View>(store, actions)
130-
return sel
131-
}
132-
*/
133-
13481
/**
13582
* @param actions - a PresenterBuilder describing actions to be taken on state changes.
13683
* usage:
@@ -148,38 +95,4 @@ fun <State : Any, V: View<State>> createGenericPresenter(actions: PresenterBuild
14895
}
14996
}
15097
}
151-
/*
152-
153-
val searchPresenterSubscriberD: SelectorSubscriberD<AppState, SearchView> = {
154-
{ store ->
155-
SelectorSubscriberFn<AppState, SearchView>(store) {
156-
plus { AppState::isLoadingItems[0] } + { showLoading() }
157-
plus { it.isLoadingItems } + { showLoading() }
158-
}//(store)
159-
}
160-
}
161-
val searchPresenterSubscriberD2: SelectorSubscriberD<AppState, SearchView> = {
162-
{
163-
selectFun<AppState, SearchView>(it) {
164-
plus { AppState::isLoadingItems[0] } + { showLoading() }
165-
plus { it.isLoadingItems } + { showLoading() }
166-
}//(store)
167-
}
168-
}
169-
val searchPresenterSubscriberD3 = createGenericPresenter<AppState, SearchView> {
170-
{
171-
plus { it.isLoadingItems } + { showLoading() }
172-
}
173-
}
17498

175-
176-
fun test(view: SearchView) {
177-
val store = createStore()
178-
searchPresenterSubscriber(SelectorSubscriberBuilder(store))(view)
179-
searchPresenterSubscriberB(view)(SelectorSubscriberBuilder(store))
180-
val subscriber = searchPresenterSubscriberC(view)(store)
181-
val subscriberD = searchPresenterSubscriberD(view)(store)
182-
val subscriberD2 = searchPresenterSubscriberD2(view)(store)
183-
val subscriberD3 = searchPresenterSubscriberD3(view)(store)
184-
}
185-
*/

common/src/commonMain/kotlin/com/willowtreeapps/common/external/reselect.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.willowtreeapps.common
1+
package com.willowtreeapps.common.external
22

33
import kotlin.jvm.JvmField
44

0 commit comments

Comments
 (0)