import {
    REMINDER_FETCH,
    REMINDER_CREATE,
    REMINDER_UPDATE,
    REMINDER_DELETE,
} from './../actions/types'
import { ToastAndroid } from 'react-native';

const INITIAL_STATE = { reminders: [] }

export default (state = INITIAL_STATE, action) => {
    switch (action.type) {

        case REMINDER_CREATE:
            state = Object.assign([], state, { reminders: action.payload })
            return state;

        case REMINDER_FETCH:
            state = Object.assign([], state, { reminders: action.payload });
            return state;

        case REMINDER_UPDATE:
            state = Object.assign([], state, { reminders: action.payload });
            return state;

        case REMINDER_DELETE:
            state = Object.assign([], state, { reminders: action.payload });
            return state;

        default:
            return state
    }
}
