Example todo reducer
todos_reducer = -> (state, action) { | |
state ||= [] | |
case action[:type] | |
when 'add' | |
state.push(action[:todo]) | |
when 'remove' | |
state.remove(action[:todo]) | |
else | |
state | |
end | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment