Payment list template Override using mixins.js in Magento 2.

What is Javascript Mixins in Magento 2?

    • Mixin is an alternative to inheritance, without overriding the entire base file, You can add new methods or change/modify the current method output in the mixins file.
    • Mixins is a class that contains methods for use by other classes without having to be the parent class of those other classes.
    • Class Methods are added to or mixed in with parent class methods.

I will show you just a simple demo for mixins,
Using the example mixins in this article, We are overriding the list.html file with our mixins and changing the Payment Title with the getGroupTitle()method.

Just for reference, I have taken Rbj_Checkout as a module name.

Now We need to override the list.js file because getGroupTitle() method coming from it.
Create a requirejs-config.js file,

var config = {
    config: {
        'mixins': {
            'Magento_Checkout/js/view/payment/list': {
                'Rbj_Checkout/js/view/payment/list': true
            }
        }
    }
};

You can define mixins file like the above way, using mixins keywords.
The Magento core file name is used as a key for the mixins object.

'mixins': {
    'Magento_Checkout/js/view/payment/list': {
        'Rbj_Checkout/js/view/payment/list': true
    }
}

Parent file: Magento_Checkout/js/view/payment/list
Mixins file: Rbj_Checkout/js/view/payment/list

Now you need to create a mixins file at a location,
Path: app/code/Rbj/Checkout/view/frontend/web/js/view/payment/list.js

/**
 * Mixin for Magento_Checkout/js/view/payment/list
 */

define([
    'jquery',
], function (
    $
) {
    'use strict';

    return function (Payment) {
        return Payment.extend({
            /**
             * Returns payment group title
             */
            getGroupTitle: function () {
                var title = "Payments list";

                return title;
            }
        });
    }
});

Using the above way, We have overridden the core getGroupTitle() method and changed the Payment title name on the payment page.

Once you go to the checkout page on your site, You can able to see the updated Group Title for the payment page.