react-dyn-tabs
Version:
React dynamic tabs with full API
26 lines (25 loc) • 945 B
JavaScript
import {apiProps, apiConstructor} from './api.factory';
import OptionManager from './optionManager/optionManager.js';
import helper from '../helper';
import ActivedTabsHistory from './activedTabsHistory';
import Pub_Sub from './pub_sub.js';
import BaseApi from './baseApi.js';
import Tabs from './tabs.js';
const getDeps = function (options = {}) {
const activedTabsHistory = new ActivedTabsHistory(),
optionsManager = new OptionManager({options});
BaseApi.call(this, {
helper,
initialState: optionsManager.initialState,
});
Tabs.call(this, {initialTabs: optionsManager.initialTabs});
Pub_Sub.call(this);
return {
activedTabsHistory,
helper,
optionsManager,
};
};
apiConstructor.prototype = Object.create(BaseApi.prototype);
export default (helper.assingAll(apiConstructor.prototype, Tabs.prototype, Pub_Sub.prototype, apiProps).constructor =
apiConstructor).bind(null, getDeps);