This file contains hidden or 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
| export class SliderComponent { | |
| @Input() slides: Array<Slider>; | |
| @Input() title: string; | |
| } |
This file contains hidden or 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
| slider(title="Последние новости", [slides]="slides") |
This file contains hidden or 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.ngRedux.dispatch({ | |
| type: UserActions.UPDATE_USER_SUCCESS, | |
| payload: data | |
| }); |
This file contains hidden or 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.ngRedux.dispatch({ type: UserActions.GET_USER_REQUESTED }); |
This file contains hidden or 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.userActions.getAccount(); |
This file contains hidden or 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
| getUser = (action$: ActionsObservable<any>) => { | |
| return action$.ofType(UserActions.GET_USER_REQUESTED).mergeMap(() => { | |
| return this.auth | |
| .validateUser() | |
| .map(result => ({ | |
| type: UserActions.GET_USER_SUCCESS, | |
| payload: result | |
| })) | |
| .catch(error => | |
| Observable.of({ |
This file contains hidden or 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
| import { Injectable } from '@angular/core'; | |
| import { createEpicMiddleware } from 'redux-observable'; | |
| import { UserEpics } from './user/epics'; | |
| import { FriendsEpics } from './friends/epics'; | |
| @Injectable() | |
| export class RootEpics { | |
| constructor( | |
| private userEpics: UserEpics, |
This file contains hidden or 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
| import { combineReducers, Reducer } from 'redux'; | |
| import { UserReducer } from './user/reducer'; | |
| import { FriendsReducer } from './friends/reducer'; | |
| import { ErrorsReducer } from './errors/reducer'; | |
| export const rootReducer: Reducer<any> = combineReducers({ | |
| user: UserReducer, | |
| friends: FriendsReducer, | |
| errors: ErrorsReducer, |
This file contains hidden or 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
| import { | |
| NgReduxModule, | |
| NgRedux, | |
| DevToolsExtension | |
| } from '@angular-redux/store'; | |
| import { rootReducer } from './store/reducers'; | |
| import { RootEpics } from './store/epics'; | |
| export class AppModule { |
This file contains hidden or 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.ngRedux.select(‘user’).subscribe((result: User) => { | |
| this.userData = result.userData; | |
| this.userLoading = result.loading; | |
| }); |