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
/** | |
* Threadsafe wrapper for ReduxKotlin store that synchronizes access to each function using | |
* kotlinx.AtomicFu [https://github.com/Kotlin/kotlinx.atomicfu] | |
* Allows all store functions to be accessed from any thread. | |
* This does have a performance impact for JVM/Native. | |
* For use with [https://ReduxKotlin.org] | |
*/ | |
class SynchronizedStore<TState>(val store: Store<TState>) : Store<TState>, SynchronizedObject() { | |
override var dispatch: Dispatcher = { action -> |
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
/** | |
* Wraps all calls to Redux store with a profile function that reports the | |
* milliseconds to complete operation. getCurrentSystemTime & logger are passed as params | |
* so can work in multiplatform (provide your own implementation) | |
* | |
* @param store Redux store from [https://ReduxKotlin.org] | |
* @param getCurrentSystemTime function that returns current sys time in ms | |
* @param logger function that logs | |
*/ | |
class ProfilingStore<T>( |
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
val response: MyFoodWrapper = client.get { | |
apiUrl("url_to_polymorphic_json") | |
} | |
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
MastHead mastHead=new MastHead(); | |
NavLink logIn=new NavLink("Log In"); | |
NavLink aboutButton=new NavLink("About"); | |
mastHead.setText("My Awesome App"); | |
mastHead.setSubtext("Subtitle"); | |
mastHead.addButton(logIn); | |
mastHead.addButton(aboutButton); |