Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/anwesh43/redux-for-android
An android module implementing famous redux for react architecture
https://github.com/anwesh43/redux-for-android
android android-library android-ui redux
Last synced: 4 days ago
JSON representation
An android module implementing famous redux for react architecture
- Host: GitHub
- URL: https://github.com/anwesh43/redux-for-android
- Owner: Anwesh43
- Created: 2017-04-14T17:09:52.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-04-14T17:30:18.000Z (almost 8 years ago)
- Last Synced: 2024-12-26T12:42:24.392Z (about 2 months ago)
- Topics: android, android-library, android-ui, redux
- Language: Java
- Size: 127 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.MD
Awesome Lists containing this project
README
### Redux For Android
#### Implementing redux for android
### Usage
#### Adding the dependencies in build.gradle
```
dependencies {
compile project(':redux')
}
```#### Creating a custom Action class
```
class CustomAction {
private String type="CUSTOM";
public CustomAction() {
super("CUSTOM");
}
}
```
##### CustomAction can also hold some data required for the action#### Creating reducer
```
Reducer reducer = new Reducer() {
public void onReduce(State state,Action action) {
switch(action.type) {}
}
}
```#### Creating store
```
Store store = Store.createStore(store);
```#### Subscribing for store changes
```
store.subscribe(new StoreSubscriber() {
public void onSubscribe() {}
});
```#### Dispatching an Action to store
```
store.dispatch(action);
```