Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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);
```