Mixins for Checkout estimation.js file Magento 2.

We can create mixins for Magento_Checkout/js/view/estimation file to modify the core Javascript method or add a new method to the file.

To create mixins, first, create a requirejs-config.js file in the module view/frontend area.


var config = {
    config: {
        mixins: {
             * Mixin for always show sidebar.
            'Magento_Checkout/js/view/estimation': {
                'Jesadiya_Estimation/js/view/estimation-mixin': true

Create Mixins js file to modify the core module’s original file with our changes,

], function (
) {
    'use strict';

    return function (Estimation) {
        return Estimation.extend({
             * Show sidebar.
            showSidebar: function () {
                // you can add custom logic before show sidebar

You can add your custom logic before show sidebar with mixins,

Using the above way you can also modify other functions of estimation.js in the checkout module.