Slide 24
Slide 24 text
REDUCER
@AutoReducer
public abstract class NotesListReducer implements Reducer> {
@AutoReducer.InitialState
List initialState() {
return TreePVector.empty();
}
@Action(value = NotesActions.ADD_ACTION,
from = NotesActions.class)
public List add(List state, int id, String content) {
return TreePVector.from(state).plus(new Note(id, content, false));
}
public static NotesListReducer create() {
return new NotesListReducerImpl();
}
}