Skip to content

Commit

Permalink
Removed store factory methods and unecessary files
Browse files Browse the repository at this point in the history
  • Loading branch information
evant committed Oct 9, 2016
1 parent cec5461 commit 1416143
Show file tree
Hide file tree
Showing 30 changed files with 7 additions and 18 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/build
build/
*.iml
/.idea
/.gradle
1 change: 0 additions & 1 deletion .gradle/2.13/taskArtifacts/cache.properties

This file was deleted.

Binary file removed .gradle/2.13/taskArtifacts/cache.properties.lock
Binary file not shown.
Binary file removed .gradle/2.13/taskArtifacts/fileHashes.bin
Binary file not shown.
Binary file removed .gradle/2.13/taskArtifacts/fileSnapshots.bin
Binary file not shown.
Binary file removed .gradle/2.13/taskArtifacts/taskArtifacts.bin
Binary file not shown.
1 change: 0 additions & 1 deletion .gradle/2.14.1/taskArtifacts/cache.properties

This file was deleted.

Binary file removed .gradle/2.14.1/taskArtifacts/cache.properties.lock
Binary file not shown.
Binary file removed .gradle/2.14.1/taskArtifacts/fileHashes.bin
Binary file not shown.
Binary file removed .gradle/2.14.1/taskArtifacts/fileSnapshots.bin
Binary file not shown.
Binary file not shown.
Binary file removed .gradle/2.14.1/taskArtifacts/taskArtifacts.bin
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public abstract class AbstractStore<A, S> implements Store<A, S> {
private Middleware<A> end;

@SafeVarargs
protected AbstractStore(S initialState, final Reducer<A, S> reducer, MiddlewareFactory<A, S>... middleware) {
public AbstractStore(S initialState, final Reducer<A, S> reducer, MiddlewareFactory<A, S>... middleware) {
if (reducer == null) {
throw new NullPointerException("reducer == null");
}
Expand Down
5 changes: 0 additions & 5 deletions redux-core/src/main/java/me/tatarka/redux/ListenerStore.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@
*/
public class ListenerStore<A, S> extends AbstractStore<A, S> {

@SafeVarargs
public static <A, S> ListenerStore<A, S> create(S initialState, Reducer<A, S> reducer, MiddlewareFactory<A, S>... middleware) {
return new ListenerStore<>(initialState, reducer, middleware);
}

private volatile S state;

private final CopyOnWriteArrayList<Listener<S>> listeners = new CopyOnWriteArrayList<>();
Expand Down
7 changes: 1 addition & 6 deletions redux-rx/src/main/java/me/tatarka/redux/ObservableStore.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,7 @@
public class ObservableStore<A, S> extends ListenerStore<A, S> {

@SafeVarargs
public static <A, S> ObservableStore<A, S> create(S initialState, Reducer<A, S> reducer, MiddlewareFactory<A, S>... middleware) {
return new ObservableStore<>(initialState, reducer, middleware);
}

@SafeVarargs
ObservableStore(S initialState, Reducer<A, S> reducer, MiddlewareFactory<A, S>... middleware) {
public ObservableStore(S initialState, Reducer<A, S> reducer, MiddlewareFactory<A, S>... middleware) {
super(initialState, reducer, middleware);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class TodoStateLoader extends StateLoader<TodoList> {
private static final ReplayMiddleware<Object, TodoList> REPLAY_MIDDLEWARE = new ReplayMiddleware<>();

public TodoStateLoader(Context context) {
super(context, ListenerStore.create(
super(context, new ListenerStore<>(
TodoList.initial(),
TodoListReducers.reducer(),
new ThunkMiddleware<Object, TodoList>(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public String toString() {
}

public static void main(String[] args) {
ObservableStore<Object, Person> store = ObservableStore.create(new Person("nobody", 0), updatePerson, new LogMiddleware<>());
ObservableStore<Object, Person> store = new ObservableStore<>(new Person("nobody", 0), updatePerson, new LogMiddleware<>());
store.observable().subscribe(person -> System.out.println("state: " + person));
store.dispatch(new ChangeName("Bob"));
store.dispatch(new IncrementAge());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public String toString() {
}

public static void main(String[] args) {
ObservableStore<Object, Integer> store = ObservableStore.create(0, counter, new LogMiddleware<>());
ObservableStore<Object, Integer> store = new ObservableStore<>(0, counter, new LogMiddleware<>());
store.observable().subscribe(count -> System.out.println("state: " + count));
store.dispatch(new Increment());
store.dispatch(new Add(2));
Expand Down

0 comments on commit 1416143

Please sign in to comment.