mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
add repository patter for chat
This commit is contained in:
+22
-1
@@ -95,6 +95,8 @@ import { VisibilityDirective } from './services/directives/visibility.directive'
|
||||
import { DeplomaOptionsPageModule } from './shared/popover/deploma-options/deploma-options.module';
|
||||
import { DiplomaOptionsPage } from './shared/popover/deploma-options/deploma-options.page';
|
||||
import { ImageCropperModule } from 'ngx-image-cropper';
|
||||
import { createAction, createReducer, on, StoreModule } from '@ngrx/store';
|
||||
import { chatReducer } from './services/Repositorys/chat/data-source/room-memory-data-source';
|
||||
// import { ServiceWorkerModule } from '@angular/service-worker';
|
||||
// import { AngularFireModule } from '@angular/fire';
|
||||
// import { AngularFireMessagingModule } from '@angular/fire/messaging';
|
||||
@@ -122,9 +124,28 @@ import { FirebaseX } from '@ionic-native/firebase-x/ngx'; */
|
||||
// Forward the init method to the sibling Framework.
|
||||
SentrySibling.init
|
||||
);
|
||||
|
||||
export const increment = createAction('[Counter Component] Increment');
|
||||
export const decrement = createAction('[Counter Component] Decrement');
|
||||
export const reset = createAction('[Counter Component] Reset');
|
||||
|
||||
export const initialState = 0;
|
||||
|
||||
const _counterReducer = createReducer(
|
||||
initialState,
|
||||
on(increment, (state) => state + 1),
|
||||
on(decrement, (state) => state - 1),
|
||||
on(reset, (state) => 0)
|
||||
);
|
||||
|
||||
export function counterReducer(state, action) {
|
||||
return _counterReducer(state, action);
|
||||
}
|
||||
|
||||
@NgModule({
|
||||
declarations: [AppComponent, PopupQuestionPipe, InputFilterDirective],
|
||||
imports: [BrowserModule,
|
||||
StoreModule.forRoot({ count: counterReducer, chat: chatReducer }),
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
CalendarModule.forRoot({
|
||||
@@ -223,7 +244,7 @@ import { FirebaseX } from '@ionic-native/firebase-x/ngx'; */
|
||||
{ provide: HTTP_INTERCEPTORS, useClass: LoggingInterceptorService, multi: true },
|
||||
chatTokenInterceptor,
|
||||
tokenInterceptor,
|
||||
|
||||
|
||||
|
||||
],
|
||||
bootstrap: [AppComponent],
|
||||
|
||||
Reference in New Issue
Block a user