@obsidize/rx-map
Version:
ES6 Map with rxjs extensions for change detection
16 lines (15 loc) • 728 B
JavaScript
export var ChangeDetectionResultType;
(function (ChangeDetectionResultType) {
ChangeDetectionResultType["CREATE"] = "CREATE";
ChangeDetectionResultType["UPDATE"] = "UPDATE";
ChangeDetectionResultType["DELETE"] = "DELETE";
ChangeDetectionResultType["NO_CHANGE"] = "NO_CHANGE";
})(ChangeDetectionResultType || (ChangeDetectionResultType = {}));
/**
* Returns true if the given value is a valid detection type, except for the NO_CHANGE type.
* (i.e. any type that indicates state mutation has occurred)
*/
export function isActionableChangeDetectionResultType(value) {
return value !== ChangeDetectionResultType.NO_CHANGE
&& Object.values(ChangeDetectionResultType).includes(value);
}