Skip to content

Commit

Permalink
Address some of the review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-okrushko committed Mar 28, 2019
1 parent 93d295e commit 085ad4a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
2 changes: 2 additions & 0 deletions modules/store/spec/action_creator.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { expecter } from 'ts-snippet';

describe('Action Creators', () => {
let originalTimeout: number;

beforeEach(() => {
originalTimeout = jasmine.DEFAULT_TIMEOUT_INTERVAL;
jasmine.DEFAULT_TIMEOUT_INTERVAL = 2000;
Expand Down Expand Up @@ -74,6 +75,7 @@ describe('Action Creators', () => {
`).toFail(/'bar' does not exist on type/);
});
});

describe('empty', () => {
it('should allow empty action', () => {
const foo = createAction('FOO');
Expand Down
8 changes: 5 additions & 3 deletions projects/example-app/src/app/auth/actions/auth-api.actions.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { union, props, createAction } from '@ngrx/store';
import { props, createAction } from '@ngrx/store';
import { User } from '@example-app/auth/models/user';

export const loginSuccess = createAction(
Expand All @@ -13,5 +13,7 @@ export const loginFailure = createAction(

export const loginRedirect = createAction('[Auth/API] Login Redirect');

const all = union({ loginSuccess, loginFailure, loginRedirect });
export type AuthApiActionsUnion = typeof all;
// This is an alternative to union() type export.
export type AuthApiActionsUnion = ReturnType<
typeof loginSuccess | typeof loginFailure | typeof loginRedirect
>;
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { createAction, union } from '@ngrx/store';
import { createAction } from '@ngrx/store';

/**
* Load Collection Action
*/
export const loadCollection = createAction('[Collection Page] Load Collection');

const all = union({ loadCollection });
export type CollectionPageActionsUnion = typeof all;
export type CollectionPageActionsUnion = ReturnType<typeof loadCollection>;
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { reducer } from '@example-app/books/reducers/books.reducer';
import { union } from '@ngrx/store';
import * as fromBooks from '@example-app/books/reducers/books.reducer';
import {
BooksApiActions,
Expand Down

0 comments on commit 085ad4a

Please sign in to comment.