UNPKG

sententiaregum-flux-container

Version:

The flux implementation of the sententiaregum project based on facebook/flux

45 lines (37 loc) 1.22 kB
/* * This file is part of the Sententiaregum project. * * (c) Maximilian Bosch <maximilian.bosch.27@gmail.com> * (c) Ben Bieler <benjaminbieler2014@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.chain = undefined; var _autoCurry = require('./util/autoCurry'); var _autoCurry2 = _interopRequireDefault(_autoCurry); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /** * Simple helper utility which creates an event subscription. * * @param {Function} chain The chain of handlers. * @param {Array} dependencies The event dependencies. * * @returns {Object} The subscription. */ exports.default = function () { var chain = arguments.length <= 0 || arguments[0] === undefined ? null : arguments[0]; var dependencies = arguments.length <= 1 || arguments[1] === undefined ? [] : arguments[1]; if (!chain) { return { dependencies: dependencies }; } return { dependencies: dependencies, function: chain() }; }; exports.chain = _autoCurry2.default;