-
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
Showing
11 changed files
with
141 additions
and
54 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { ActionReducerMap, ActionReducer, MetaReducer } from '@ngrx/store'; | ||
import { CognitoState, cognitoReducer } from 'ngrx-cognito'; | ||
import { environment } from 'src/environments/environment'; | ||
|
||
export interface AppState { | ||
cognito: CognitoState; | ||
} | ||
|
||
export const appReducers: ActionReducerMap<AppState> = { | ||
cognito: cognitoReducer | ||
}; | ||
|
||
// log all actions | ||
export function logActions(reducer: ActionReducer<AppState>): ActionReducer<AppState> { | ||
return (state: AppState, action: any): any => { | ||
const result = reducer(state, action); | ||
console.groupCollapsed(action.type); | ||
console.log('prev state', state); | ||
console.log('action', action); | ||
console.log('next state', result); | ||
console.groupEnd(); | ||
return result; | ||
}; | ||
} | ||
|
||
export const metaReducers: MetaReducer<AppState>[] = !environment.production ? [logActions] : []; |
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,3 +1,5 @@ | ||
export const environment = { | ||
production: true | ||
production: true, | ||
cognitoAppClientId: '', | ||
cognitoUserPoolId: '' | ||
}; |
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,14 +1,19 @@ | ||
<!doctype html> | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>NgrxCognitoApp</title> | ||
<base href="/"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<title>NgrxCognitoApp</title> | ||
<base href="/" /> | ||
|
||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<link rel="icon" type="image/x-icon" href="favicon.ico"> | ||
</head> | ||
<body> | ||
<app-root></app-root> | ||
</body> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
<link rel="icon" type="image/x-icon" href="favicon.ico" /> | ||
<script> | ||
if (global === undefined) { | ||
var global = window; | ||
} | ||
</script> | ||
</head> | ||
<body> | ||
<app-root></app-root> | ||
</body> | ||
</html> |