Last active
October 12, 2016 20:07
-
-
Save pardom-zz/12548b1a4dab4723fb433a0eb629831e to your computer and use it in GitHub Desktop.
JVM Redux API
This file contains hidden or 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 hidden or 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 hidden or 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 Reducer<S> { | |
S reduce(S state, Object action); | |
} |
This file contains hidden or 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 Store<S> extends Dispatcher { | |
S getState(); | |
Subscription subscribe(Subscriber subscriber); | |
void replaceReducer(Reducer<S> reducer); | |
interface Creator<S> { | |
Store<S> create(Reducer<S> reducer, S initialState, Enhancer<S> enhancer); | |
} | |
interface Enhancer<S> { | |
Creator<S> enhance(Creator<S> next); | |
} | |
interface Subscriber { | |
void onStateChanged(); | |
} | |
interface Subscription { | |
void unsubscribe(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment