import {combineReducers} from 'redux';
import usersById, * as fromUsersById from './usersById';
import list from './userList';
import form from './userForm';

const users = combineReducers({
  usersById,
  list,
  form
});

export default users;

export const getUsers = (state) =>
  state.list.ids.map(id => fromUsersById.getUser(state.usersById, id));
