Skip to content

Commit 09aad36

Browse files
committed
feat: export constant ALL_NGRX_FORMS_ACTION_TYPES that is an array of all action types ngrx-forms provides
1 parent a899722 commit 09aad36

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

src/actions.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,3 +259,29 @@ export type Actions<TValue> =
259259
export function isNgrxFormsAction(action: Action) {
260260
return !!action.type && action.type.startsWith('ngrx/forms/');
261261
}
262+
263+
export const ALL_NGRX_FORMS_ACTION_TYPES: Actions<any>['type'][] = [
264+
SetValueAction.TYPE,
265+
SetErrorsAction.TYPE,
266+
SetAsyncErrorAction.TYPE,
267+
ClearAsyncErrorAction.TYPE,
268+
StartAsyncValidationAction.TYPE,
269+
MarkAsDirtyAction.TYPE,
270+
MarkAsPristineAction.TYPE,
271+
EnableAction.TYPE,
272+
DisableAction.TYPE,
273+
MarkAsTouchedAction.TYPE,
274+
MarkAsUntouchedAction.TYPE,
275+
FocusAction.TYPE,
276+
UnfocusAction.TYPE,
277+
MarkAsSubmittedAction.TYPE,
278+
MarkAsUnsubmittedAction.TYPE,
279+
AddGroupControlAction.TYPE,
280+
RemoveGroupControlAction.TYPE,
281+
AddArrayControlAction.TYPE,
282+
RemoveArrayControlAction.TYPE,
283+
SetUserDefinedPropertyAction.TYPE,
284+
ResetAction.TYPE,
285+
SwapArrayControlAction.TYPE,
286+
MoveArrayControlAction.TYPE,
287+
];

src/ngrx-forms.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import {
22
addArrayControl,
33
addGroupControl,
4+
ALL_NGRX_FORMS_ACTION_TYPES,
45
box,
56
clearAsyncError,
67
compose,
@@ -56,6 +57,7 @@ import {
5657
} from './ngrx-forms';
5758

5859
describe('ngrx-forms', () => {
60+
it(`should export ALL_NGRX_FORMS_ACTION_TYPES`, () => expect(ALL_NGRX_FORMS_ACTION_TYPES).toBeDefined());
5961
it(`should export ${compose.name}`, () => expect(compose).toBeDefined());
6062
it(`should export ${isArrayState.name}`, () => expect(isArrayState).toBeDefined());
6163
it(`should export ${isGroupState.name}`, () => expect(isGroupState).toBeDefined());

0 commit comments

Comments
 (0)