1 | "use strict";
|
2 | var __extends = (this && this.__extends) || (function () {
|
3 | var extendStatics = function (d, b) {
|
4 | extendStatics = Object.setPrototypeOf ||
|
5 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
6 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
7 | return extendStatics(d, b);
|
8 | };
|
9 | return function (d, b) {
|
10 | extendStatics(d, b);
|
11 | function __() { this.constructor = d; }
|
12 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
13 | };
|
14 | })();
|
15 | var __assign = (this && this.__assign) || function () {
|
16 | __assign = Object.assign || function(t) {
|
17 | for (var s, i = 1, n = arguments.length; i < n; i++) {
|
18 | s = arguments[i];
|
19 | for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
20 | t[p] = s[p];
|
21 | }
|
22 | return t;
|
23 | };
|
24 | return __assign.apply(this, arguments);
|
25 | };
|
26 | Object.defineProperty(exports, "__esModule", { value: true });
|
27 | var helper_1 = require("../helper");
|
28 | var types_1 = require("../types");
|
29 | var types_2 = require("./types");
|
30 |
|
31 |
|
32 |
|
33 |
|
34 | var Features = (function (_super) {
|
35 | __extends(Features, _super);
|
36 | function Features(app, options) {
|
37 | return _super.call(this, app, types_1.Group.Features, types_1.Group.Features, options ? options.id : undefined) || this;
|
38 | }
|
39 | |
40 |
|
41 |
|
42 | Features.prototype.dispatch = function (action, payload) {
|
43 | switch (action) {
|
44 | case types_2.Action.REQUEST:
|
45 | this.dispatchFeaturesAction(types_2.ActionType.REQUEST, payload);
|
46 | break;
|
47 | }
|
48 | return this;
|
49 | };
|
50 | |
51 |
|
52 |
|
53 | Features.prototype.dispatchFeaturesAction = function (type, payload) {
|
54 | this.app.dispatch(helper_1.actionWrapper({
|
55 | group: types_1.Group.Features,
|
56 | type: type,
|
57 | payload: __assign({}, (payload || {}), { id: this.id }),
|
58 | }));
|
59 | };
|
60 | return Features;
|
61 | }(helper_1.ActionSet));
|
62 | exports.Features = Features;
|
63 |
|
64 |
|
65 |
|
66 | function create(app, options) {
|
67 | return new Features(app, options);
|
68 | }
|
69 | exports.create = create;
|