@datorama/akita-ng-effects
Version:
A Reactive State Management extension dealing with side effects.
23 lines • 834 B
JavaScript
import { __rest } from "tslib";
import { Injectable } from '@angular/core';
import { Subject } from 'rxjs';
import { logAction } from '@datorama/akita';
import * as i0 from "@angular/core";
export class Actions extends Subject {
dispatch(value) {
this.logAction(value);
this.next(value);
}
logAction(value) {
const { type } = value, props = __rest(value, ["type"]);
const 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',
},] }
];
//# sourceMappingURL=actions.js.map