Module

utils/mix

@ckeditor/ckeditor5-utils/src/mix

module

Filtering

Functions

  • mix( [ baseClass ], [ ...mixins ] )

    static

    Copies enumerable properties and symbols from the objects given as 2nd+ parameters to the prototype of first object (a constructor).

    class Editor {
        ...
    }
    
    const SomeMixin = {
        a() {
            return 'a';
        }
    };
    
    mix( Editor, SomeMixin, ... );
    
    new Editor().a(); // -> 'a'

    Note: Properties which already exist in the base class will not be overriden.

    Parameters

    [ baseClass ] : function

    Class which prototype will be extended.

    [ ...mixins ] : Object

    Objects from which to get properties.