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 { Subject } from 'rxjs'; | |
| const randomVals$ = new Subject().next(Math.random());} | |
| // Subscribe to run the combined functions | |
| randomVals$.subscribe(x => console.log(x)); | |
| // 0.24957144215097515 (random number) | |
| randomVals$.subscribe(x => console.log(x)); | |
| // 0.004617340049055896 (random number) |
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 { Subject } from 'rxjs'; | |
| const randomVals$ = new Subject().next(Math.random());} | |
| // Subscribe to run the combined functions | |
| randomVals$.subscribe(x => console.log(x)); | |
| // 0.24957144215097515 (random number) | |
| randomVals$.subscribe(x => console.log(x)); | |
| // 0.004617340049055896 (random number) |
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
| @Effect() | |
| loadAllBlogPosts$: Observable<any> = this.actions$.pipe( | |
| ofType(PokemonActions.loadPokemon), | |
| mergeMap(() => | |
| this.postsService.getAll().pipe( | |
| map(posts => PokemonActions.loadPokemonSuccess({ posts })), | |
| catchError(message => of(PokemonActions.loadPostsFailed({ message }))) | |
| ) | |
| ) | |
| ); |
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
| @Effect() | |
| findAddresses: Observable<any> = this.actions.pipe( | |
| ofType(LocationActionTypes.FindAddresses), | |
| map(action => action.partialAddress), | |
| debounceTime(400), | |
| distinctUntilChanged(), | |
| switchMap(partialAddress => this.backend | |
| .findAddresses(partialAddress) | |
| .pipe( | |
| map(results => new FindAddressesFulfilled(results)), |
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
| @Effect() | |
| loadAllBlogPosts$: Observable<any> = this.actions$.pipe( | |
| ofType(PokemonActions.loadPokemon), | |
| mergeMap(() => | |
| this.postsService.getAll().pipe( | |
| map(posts => PokemonActions.loadPokemonSuccess({ posts })), | |
| catchError(message => of(PokemonActions.loadPostsFailed({ message }))) | |
| ) | |
| ) | |
| ); |
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 { LOCALE_ID, NgModule } from '@angular/core'; | |
| import { BrowserModule } from '@angular/platform-browser'; | |
| import { AppComponent } from '../src/app/app.component'; | |
| @NgModule({ | |
| imports: [ BrowserModule ], | |
| declarations: [ AppComponent ], | |
| providers: [ { provide: LOCALE_ID, useValue: 'fr' } ], | |
| bootstrap: [ AppComponent ] |
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 { LOCALE_ID, NgModule } from '@angular/core'; | |
| import { BrowserModule } from '@angular/platform-browser'; | |
| import { AppComponent } from '../src/app/app.component'; | |
| @NgModule({ | |
| imports: [ BrowserModule ], | |
| declarations: [ AppComponent ], | |
| providers: [ { provide: LOCALE_ID, useValue: 'fr' } ], | |
| bootstrap: [ AppComponent ] |
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 { enableProdMode, TRANSLATIONS, TRANSLATIONS_FORMAT } from '@angular/core'; | |
| import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; | |
| import { AppModule } from './app/app.module'; | |
| import { environment } from './environments/environment'; | |
| if (environment.production) { | |
| enableProdMode(); | |
| } |
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 { enableProdMode, TRANSLATIONS, TRANSLATIONS_FORMAT } from '@angular/core'; | |
| import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; | |
| import { AppModule } from './app/app.module'; | |
| import { environment } from './environments/environment'; | |
| if (environment.production) { | |
| enableProdMode(); | |
| } |
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
| ... | |
| "architect": { | |
| "build": { | |
| "builder": "@angular-devkit/build-angular:browser", | |
| "options": { ... }, | |
| "configurations": { | |
| "fr": { | |
| "aot": true, | |
| "outputPath": "dist/my-project-fr/", | |
| "i18nFile": "src/locale/messages.fr.xlf", |