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
interface Dispatcher { | |
Object dispatch(Object 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
interface Middleware<S> { | |
Object dispatch(Store<S> store, Object action, Dispatcher next); | |
} |
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
interface Middleware<S> { | |
Object dispatch(StateProvider<S> stateProvier, Object action, Dispatcher next); | |
interface StateProvider<S> { | |
S getState(); | |
} |
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
fun Any.prettyPrint(): String { | |
val sb = StringBuilder() | |
val chars = toString().toCharArray() | |
var level = 0 | |
var inString = false | |
var inArray = false | |
for (char in chars) { | |
when (char) { | |
'(' -> { | |
if (!inString) { |
OlderNewer