UNPKG

@datorama/akita-ng-effects

Version:

A Reactive State Management extension dealing with side effects.

29 lines 1.13 kB
import { __extends, __rest } from "tslib"; import { Injectable } from '@angular/core'; import { Subject } from 'rxjs'; import { logAction } from '@datorama/akita'; import * as i0 from "@angular/core"; var Actions = /** @class */ (function (_super) { __extends(Actions, _super); function Actions() { return _super !== null && _super.apply(this, arguments) || this; } Actions.prototype.dispatch = function (value) { this.logAction(value); this.next(value); }; Actions.prototype.logAction = function (value) { var type = value.type, props = __rest(value, ["type"]); var hasPayload = Object.getOwnPropertyNames(props).length > 0; logAction(type, null, hasPayload ? props : null); }; Actions.ɵprov = i0.ɵɵdefineInjectable({ factory: function Actions_Factory() { return new Actions(); }, token: Actions, providedIn: "root" }); Actions.decorators = [ { type: Injectable, args: [{ providedIn: 'root', },] } ]; return Actions; }(Subject)); export { Actions }; //# sourceMappingURL=actions.js.map