function apiHandler (module, name, ...args) {
    const funcional = name.split().map(word => `${word[0].toUpper()}${word.slice(1)}`).join()
    const actional = name.split().map(word => word.toUpper()).join('_')

    // e.g. name: 'create user'
    // createUserRequest = (data) => {type: 'MODULE/CREATE_USER_REQUEST'}
    const actions = {
        [`${funcional}Request`] : (data) => {
            type: `${module.toUpper()}/${actional}_REQUEST`,
            data
        },
        [`${functional}Success`] : (data) => {
            type: `${module.toUpper()}/${actional}_SUCCESS`,
            data
        },
        [`${functional}Failure`] : (error) => {
            type: `${module.toUpper()}/${actional}_FAILURE`,
            error
        }
    }

    // e.g. createUserState: [0] [1] [2]
    const reducer = (state = {}, action) => {
        switch (action) {
            case `${module.toUpper()}/${actional}_REQUEST`:
                return 
            case `${module.toUpper()}/${actional}_SUCCESS`:
                return
            case `${module.toUpper()}/${actional}_FAILURE`:
                return
        }
    }

    if (args.variable)
    const state = {
        [variable]: args.variable.initState
    }
    const saga = async (action) => {}

    return {actions, reducer, state, saga}
}

function crudHandler (module, name, ...args) {
    const 
    const actions = {}
    const reducer = (state = [], action) => {
        let index
        switch (action.type) {
            // Create
            case '':
                return [ ...state, action.data ]
            // Read
            case '':
                return action.data
            // Update
            case '':
                index = state.findIndex(element => element._id === action.data._id)
                return [ ...state.slice(0, index), action.data, ...state.slice(index + 1) ]
            // Delete
            case '':
                index = state.findIndex(element => element._id === action.data._id)
                return [ ...state.slice(0, index), ...state.slice(index + 1) ]
        }
    }
    const state = {}
    const saga = async (action) => {}

    return {actions, reducer, state, saga}
}

