'How to choose AEM component for dialog and component creation

I am new to AEM (6.5),

I found different components in different locations, each component is used in component creation and dialog creation. I am confused, which component is suitable for which purpose? ie. for dialog creation and custom component creation and extending components.

Please tell me the bellow components purpose or differents or when to use it.

1 . /libs/granite/ui/components/coral/foundation 2. /libs/granite/ui/components/foundation 3. /libs/foundation/components 4. /libs/wcm/foundation/components 5. /libs/cq/gui/components/authoring 6. /apps/core/wcm/components



Solution 1:[1]

After Kapobajza answer I made these changes to my code to make it work.

reducers\index.js

    case 'DELETE_CUSTOMER_SUCCEEDED':{
        return{
            ...state,
            customers: state.customers.filter(customer => customer.id !== action.payload.id)
        }
         
    }

actions\index.js

function deleteCustomerSucceeded(id){
    return{
        type:"DELETE_CUSTOMER_SUCCEEDED",
        payload:{
           id
        }
    }
}

export function deleteCustomer(id){
    return(dispatch) =>{
        api.deleteCustomer(id).then((res) => {
            dispatch(deleteCustomerSucceeded(id))
        })
    }
}

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Beartato327