-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrades to Kotlin 1.0.0, Moved from Dagger to Injekt
- Loading branch information
Brian Egan
committed
Feb 19, 2016
1 parent
14cacc7
commit 0eadf3b
Showing
33 changed files
with
148 additions
and
1,133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 0 additions & 26 deletions
26
examples/counterPair/src/main/java/com/brianegan/bansa/counterPair/ApplicationModule.java
This file was deleted.
Oops, something went wrong.
26 changes: 0 additions & 26 deletions
26
examples/counterPair/src/main/java/com/brianegan/bansa/counterPair/StoreModule.java
This file was deleted.
Oops, something went wrong.
30 changes: 18 additions & 12 deletions
30
examples/counterPair/src/main/kotlin/com/brianegan/bansa/counterPair/Application.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,27 @@ | ||
package com.brianegan.bansa.counterPair | ||
|
||
import dagger.ObjectGraph | ||
import com.brianegan.bansa.Action | ||
import com.brianegan.bansa.Store | ||
import com.brianegan.bansa.createStore | ||
import uy.kohesive.injekt.Injekt | ||
import uy.kohesive.injekt.InjektMain | ||
import uy.kohesive.injekt.api.InjektRegistrar | ||
import uy.kohesive.injekt.api.fullType | ||
import uy.kohesive.injekt.api.get | ||
|
||
class Application : android.app.Application() { | ||
var objectGraph: ObjectGraph? = null | ||
|
||
override fun onCreate() { | ||
super.onCreate() | ||
instance = this | ||
objectGraph = ObjectGraph.create(ApplicationModule(this), StoreModule()) | ||
companion object : InjektMain() { | ||
override fun InjektRegistrar.registerInjectables() { | ||
addSingleton( | ||
fullType<Store<ApplicationState, Action>>(), | ||
createStore(ApplicationState(), applicationReducer)); | ||
} | ||
} | ||
|
||
companion object { | ||
private var instance: Application? = null | ||
val store = Injekt.get(fullType<Store<ApplicationState, Action>>()) | ||
|
||
fun getObjectGraph(): ObjectGraph? { | ||
return instance?.objectGraph | ||
} | ||
override fun onCreate() { | ||
super.onCreate() | ||
store.dispatch(INIT()) // Initialize the store | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 0 additions & 26 deletions
26
...es/listOfCounters/src/main/java/com/brianegan/bansa/listOfCounters/ApplicationModule.java
This file was deleted.
Oops, something went wrong.
26 changes: 0 additions & 26 deletions
26
examples/listOfCounters/src/main/java/com/brianegan/bansa/listOfCounters/StoreModule.java
This file was deleted.
Oops, something went wrong.
31 changes: 17 additions & 14 deletions
31
examples/listOfCounters/src/main/kotlin/com/brianegan/bansa/listOfCounters/Application.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,26 @@ | ||
package com.brianegan.bansa.listOfCounters | ||
|
||
import com.brianegan.bansa.listOfCounters.ApplicationModule | ||
import com.brianegan.bansa.listOfCounters.StoreModule | ||
import dagger.ObjectGraph | ||
import com.brianegan.bansa.Action | ||
import com.brianegan.bansa.Store | ||
import uy.kohesive.injekt.Injekt | ||
import uy.kohesive.injekt.InjektMain | ||
import uy.kohesive.injekt.api.InjektRegistrar | ||
import uy.kohesive.injekt.api.fullType | ||
import uy.kohesive.injekt.api.get | ||
|
||
class Application : android.app.Application() { | ||
var objectGraph: ObjectGraph? = null | ||
|
||
override fun onCreate() { | ||
super.onCreate() | ||
instance = this | ||
objectGraph = ObjectGraph.create(ApplicationModule(this), StoreModule()) | ||
companion object : InjektMain() { | ||
override fun InjektRegistrar.registerInjectables() { | ||
addSingleton( | ||
fullType<Store<ApplicationState, Action>>(), | ||
com.brianegan.bansa.createStore(ApplicationState(), applicationReducer)); | ||
} | ||
} | ||
|
||
companion object { | ||
private var instance: Application? = null | ||
val store = Injekt.get(fullType<Store<ApplicationState, Action>>()) | ||
|
||
fun getObjectGraph(): ObjectGraph? { | ||
return instance?.objectGraph | ||
} | ||
override fun onCreate() { | ||
super.onCreate() | ||
store.dispatch(INIT()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
examples/listOfCountersVariant/build/tmp/kapt/debug/java_src/__gen/annotation/Cl.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.