-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Vitalii Bashta
authored and
Vitalii Bashta
committed
Jan 30, 2020
1 parent
f59e71b
commit f8bdd7e
Showing
3 changed files
with
10 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import { createAction } from '@ngrx/store'; | ||
import { createAction, ActionCreator } from '@ngrx/store'; | ||
|
||
export const increment = createAction('[Counter Component] Increment'); | ||
export const decrement = createAction('[Counter Component] Decrement'); | ||
export const reset = createAction('[Counter Component] Reset'); | ||
export const increment: any = createAction('[Counter Component] Increment'); | ||
export const decrement: any = createAction('[Counter Component] Decrement'); | ||
export const reset: any = createAction('[Counter Component] Reset'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
import { createReducer, on } from '@ngrx/store'; | ||
import { increment, decrement, reset } from './counter.actions'; | ||
|
||
export const initialState = 0; | ||
export const initialState: number = 0; | ||
|
||
const _countReducer = createReducer( | ||
const _countReducer: any = createReducer( | ||
initialState, | ||
on(increment, state => state + 1), | ||
on(decrement, state => state - 1), | ||
on(increment, (state: any) => state + 1), | ||
on(decrement, (state: any) => state - 1), | ||
on(reset, () => 0), | ||
); | ||
|
||
export function countReducer(state, action) { | ||
export function countReducer(state: any, action: any): any { | ||
return _countReducer(state, action); | ||
} |