mirror of
https://github.com/Raghu-Ch/angular-challenges.git
synced 2026-02-13 14:23:02 -05:00
fix: run prettier on all file to avoid prettier issue inside PR
This commit is contained in:
@@ -1,21 +1,20 @@
|
||||
import { ApplicationConfig } from '@angular/core';
|
||||
import { provideStore } from '@ngrx/store';
|
||||
import { provideEffects } from '@ngrx/effects';
|
||||
import { TeacherEffects } from './teacher/store/teacher.effects';
|
||||
import { StudentEffects } from './student/store/student.effects';
|
||||
import { provideRouter } from '@angular/router';
|
||||
import { ROUTES } from './routes';
|
||||
import { APP_INITIALIZER, inject } from '@angular/core';
|
||||
import { FakeBackendService } from '@angular-challenges/ngrx-notification/backend';
|
||||
import { APP_INITIALIZER, ApplicationConfig, inject } from '@angular/core';
|
||||
import { provideRouter } from '@angular/router';
|
||||
import { provideEffects } from '@ngrx/effects';
|
||||
import { provideStore } from '@ngrx/store';
|
||||
import { NotificationService } from './data-access/notification.service';
|
||||
import {
|
||||
teacherReducer,
|
||||
teachersFeatureKey,
|
||||
} from './teacher/store/teacher.reducer';
|
||||
import { ROUTES } from './routes';
|
||||
import { StudentEffects } from './student/store/student.effects';
|
||||
import {
|
||||
studentReducer,
|
||||
studentsFeatureKey,
|
||||
} from './student/store/student.reducer';
|
||||
import { TeacherEffects } from './teacher/store/teacher.effects';
|
||||
import {
|
||||
teacherReducer,
|
||||
teachersFeatureKey,
|
||||
} from './teacher/store/teacher.reducer';
|
||||
|
||||
const REDUCERS = {
|
||||
[teachersFeatureKey]: teacherReducer,
|
||||
|
||||
@@ -22,12 +22,12 @@ export class NotificationService {
|
||||
.subscribe((notification: Push) => {
|
||||
if (isTeacher(notification)) {
|
||||
this.store.dispatch(
|
||||
teacherActions.addOneTeacher({ teacher: notification })
|
||||
teacherActions.addOneTeacher({ teacher: notification }),
|
||||
);
|
||||
}
|
||||
if (isStudent(notification)) {
|
||||
this.store.dispatch(
|
||||
studentActions.addOneStudent({ student: notification })
|
||||
studentActions.addOneStudent({ student: notification }),
|
||||
);
|
||||
}
|
||||
if (isSchool(notification)) {
|
||||
|
||||
@@ -35,11 +35,11 @@ export class SchoolStore
|
||||
this.httpService.getAllSchools().pipe(
|
||||
tapResponse(
|
||||
(schools) => this.patchState({ schools }),
|
||||
(_) => _
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(_) => _,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
ngrxOnStoreInit() {
|
||||
|
||||
@@ -16,8 +16,8 @@ export class StudentEffects {
|
||||
switchMap(() =>
|
||||
this.httpService
|
||||
.getAllStudents()
|
||||
.pipe(map((students) => studentActions.addAllStudents({ students })))
|
||||
)
|
||||
)
|
||||
.pipe(map((students) => studentActions.addAllStudents({ students }))),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -13,11 +13,11 @@ export const studentAdapter: EntityAdapter<Student> =
|
||||
export const studentReducer = createReducer(
|
||||
studentAdapter.getInitialState(),
|
||||
on(studentActions.addOneStudent, (state, { student }) =>
|
||||
studentAdapter.upsertOne(student, state)
|
||||
studentAdapter.upsertOne(student, state),
|
||||
),
|
||||
on(studentActions.addAllStudents, (state, { students }) =>
|
||||
studentAdapter.setAll(students, state)
|
||||
)
|
||||
studentAdapter.setAll(students, state),
|
||||
),
|
||||
);
|
||||
|
||||
export const { selectIds, selectEntities, selectAll, selectTotal } =
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { createFeatureSelector, createSelector } from '@ngrx/store';
|
||||
import {
|
||||
StudentState,
|
||||
studentAdapter,
|
||||
studentsFeatureKey,
|
||||
StudentState,
|
||||
} from './student.reducer';
|
||||
|
||||
const selectStudentState =
|
||||
|
||||
@@ -16,8 +16,8 @@ export class TeacherEffects {
|
||||
switchMap(() =>
|
||||
this.httpService
|
||||
.getAllTeachers()
|
||||
.pipe(map((teachers) => teacherActions.addAllTeachers({ teachers })))
|
||||
)
|
||||
)
|
||||
.pipe(map((teachers) => teacherActions.addAllTeachers({ teachers }))),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -13,11 +13,11 @@ export const teacherAdapter: EntityAdapter<Teacher> =
|
||||
export const teacherReducer = createReducer(
|
||||
teacherAdapter.getInitialState(),
|
||||
on(teacherActions.addOneTeacher, (state, { teacher }) =>
|
||||
teacherAdapter.upsertOne(teacher, state)
|
||||
teacherAdapter.upsertOne(teacher, state),
|
||||
),
|
||||
on(teacherActions.addAllTeachers, (state, { teachers }) =>
|
||||
teacherAdapter.setAll(teachers, state)
|
||||
)
|
||||
teacherAdapter.setAll(teachers, state),
|
||||
),
|
||||
);
|
||||
|
||||
export const { selectIds, selectEntities, selectAll, selectTotal } =
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { createFeatureSelector, createSelector } from '@ngrx/store';
|
||||
import {
|
||||
TeacherState,
|
||||
teacherAdapter,
|
||||
teachersFeatureKey,
|
||||
TeacherState,
|
||||
} from './teacher.reducer';
|
||||
|
||||
const selectTeacherState =
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
|
||||
@@ -5,5 +5,5 @@ import { bootstrapApplication } from '@angular/platform-browser';
|
||||
import { AppComponent } from './app/app.component';
|
||||
|
||||
bootstrapApplication(AppComponent, appConfig).catch((err) =>
|
||||
console.error(err)
|
||||
console.error(err),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user