UNPKG

activator-oce-exporter

Version:

Extract Activator binder and convert it to valid OCE mono pacakge

35 lines (31 loc) 1.43 kB
/** * Inspired by http://justinfagnani.com/2015/12/21/real-mixins-with-javascript-classes/ * and https://www.typescriptlang.org/docs/handbook/mixins.html * * To use a mixin just "extend" your class from applyMixins(BaseClass, [mixin]) */ import { ModeTrackable } from './mode-trackable'; import { BorderedElement } from './bordered-element'; import { VerticalAlignObservable } from './vertical-align-observable'; import { EmailComponent } from './email.js'; import { SlideComponent } from './slide.js'; import { Stateful } from './stateful.js'; import { LinkExtension } from './link-extension'; import { ItemsWrapper } from './items-wrapper'; import { ElementsAligner } from './elements-aligner'; import { ChildrenStylist } from './children-stylist'; import { AspectRatioSwitcher } from './aspect-ratio-switcher'; import { PopupElement } from './popup-element'; import { LazyComponent } from './lazy-component'; import { Font } from './font'; /** * @param {constructor} superClass: class to be extended * @param {Array} mixins: * @returns {*} */ function applyMixins(superClass, mixins) { return mixins.reduce((extendedClass, mixin) => mixin(extendedClass), superClass); } export { LazyComponent, ModeTrackable, VerticalAlignObservable, BorderedElement, LinkExtension, EmailComponent, SlideComponent, ItemsWrapper, applyMixins, Stateful, ElementsAligner, ChildrenStylist, AspectRatioSwitcher, PopupElement, Font, };