Skip to content

Instantly share code, notes, and snippets.

View wojtrawi's full-sized avatar

Wojciech Trawiński wojtrawi

  • Gdansk
View GitHub Profile
@Effect({dispatch: false})
changeExercise$ = this.actions$.pipe(
ofType(ExerciseActionTypes.Change),
flatMap(({ payload: exerciseId }) => [
new ExerciseActions.Unload(),
new ExerciseActions.SaveScore(),
new ExerciseActions.Load(exerciseId)
])
);
const cars = [
'Aston Martin',
'Ferrari',
'Porsche'
];
const carsCopy = [...cars];
const carsReversed = [];
while (carsCopy.length) {
const cars = [
'Aston Martin',
'Ferrari',
'Porsche'
];
const carsReversed = [...cars].sort(() => 1);
console.log(`My cars: ${cars}`);
console.log(`My cars reversed: ${carsReversed}`);
const { fromEvent, of } = rxjs;
const {
delay,
tap,
map,
filter,
debounceTime,
distinctUntilChanged,
switchMap
} = rxjs.operators;
const { fromEvent, of } = rxjs;
const {
delay,
tap,
map,
filter,
debounceTime,
distinctUntilChanged,
switchMap
} = rxjs.operators;
const { fromEvent, of } = rxjs;
const {
delay,
tap,
map,
filter,
debounceTime,
distinctUntilChanged,
switchMap
} = rxjs.operators;
const userName = 'Chris';
const adminName = 'Greg';
if (userName === adminName) {
console.log('Logged in as the admin');
} else {
console.log('Logged in as a regular user');
}
var userName = 'Chris';
var adminName = 'Greg';
if (userName = adminName) {
console.log('Logged in as the admin');
} else {
console.log('Logged in as a regular user');
}
const userName = 'Chris';
const adminName = 'Greg';
if (userName = adminName) {
console.log('Logged in as the admin');
} else {
console.log('Logged in as a regular user');
}
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { CarsPageComponent } from './containers/cars-page/cars-page.component';
import { SelectedCarPageComponent } from './containers/selected-car-page/selected-car-page.component';
const routes: Routes = [
{
path: 'cars',
children: [