ing
This commit is contained in:
parent
15aae744bc
commit
1ba83a802d
|
@ -9,7 +9,6 @@ import { AuthContainerSelector } from '@overflow/shared/auth/store';
|
||||||
import { DomainMember } from '@overflow/commons-typescript/model/domain';
|
import { DomainMember } from '@overflow/commons-typescript/model/domain';
|
||||||
|
|
||||||
import { NoAuthProbeService } from '../service/noauth-probe.service';
|
import { NoAuthProbeService } from '../service/noauth-probe.service';
|
||||||
import { NoAuthProbeConnectingSelector } from '../store';
|
|
||||||
import { NoAuthProbeSubscriber, NoAuthProbeNotify } from '../subscriber/noauth-probe.subscriber';
|
import { NoAuthProbeSubscriber, NoAuthProbeNotify } from '../subscriber/noauth-probe.subscriber';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
|
|
@ -1,24 +0,0 @@
|
||||||
import { NgModule } from '@angular/core';
|
|
||||||
import { StoreModule } from '@ngrx/store';
|
|
||||||
import { StoreDevtoolsModule } from '@ngrx/store-devtools';
|
|
||||||
import {
|
|
||||||
StoreRouterConnectingModule,
|
|
||||||
RouterStateSerializer,
|
|
||||||
} from '@ngrx/router-store';
|
|
||||||
import { EffectsModule } from '@ngrx/effects';
|
|
||||||
import { combineReducers, ActionReducer, ActionReducerMap, MetaReducer } from '@ngrx/store';
|
|
||||||
|
|
||||||
import {
|
|
||||||
REDUCERS,
|
|
||||||
EFFECTS,
|
|
||||||
} from './store';
|
|
||||||
|
|
||||||
import { MODULE } from './noauth-probe.constant';
|
|
||||||
|
|
||||||
@NgModule({
|
|
||||||
imports: [
|
|
||||||
StoreModule.forFeature(MODULE.name, REDUCERS),
|
|
||||||
EffectsModule.forFeature(EFFECTS),
|
|
||||||
],
|
|
||||||
})
|
|
||||||
export class NoAuthProbeStoreModule { }
|
|
|
@ -3,7 +3,6 @@ import { CommonModule } from '@angular/common';
|
||||||
|
|
||||||
import { UIModule } from '@overflow/shared/ui/ui.module';
|
import { UIModule } from '@overflow/shared/ui/ui.module';
|
||||||
|
|
||||||
import { NoAuthProbeStoreModule } from './noauth-probe-store.module';
|
|
||||||
import { NoAuthProbeRPCModule } from './noauth-probe-rpc.module';
|
import { NoAuthProbeRPCModule } from './noauth-probe-rpc.module';
|
||||||
import { NoAuthProbeLoggerModule } from './noauth-probe-logger.module';
|
import { NoAuthProbeLoggerModule } from './noauth-probe-logger.module';
|
||||||
import { COMPONENTS } from './component';
|
import { COMPONENTS } from './component';
|
||||||
|
@ -13,7 +12,6 @@ import { SERVICES } from './service';
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
CommonModule,
|
CommonModule,
|
||||||
NoAuthProbeStoreModule,
|
|
||||||
NoAuthProbeRPCModule,
|
NoAuthProbeRPCModule,
|
||||||
NoAuthProbeLoggerModule,
|
NoAuthProbeLoggerModule,
|
||||||
UIModule,
|
UIModule,
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
export * from './noauth-probe-connecting.action';
|
|
||||||
export * from './noauth-probe-connecting.effect';
|
|
||||||
export * from './noauth-probe-connecting.reducer';
|
|
||||||
export * from './noauth-probe-connecting.state';
|
|
|
@ -1,26 +0,0 @@
|
||||||
import { Action } from '@ngrx/store';
|
|
||||||
|
|
||||||
import { RPCClientError } from '@loafer/ng-rpc';
|
|
||||||
import { NoAuthProbe } from '@overflow/commons-typescript/model/noauth';
|
|
||||||
|
|
||||||
export enum ActionType {
|
|
||||||
OnConnect = '[noauth-probe.connecting] OnConnect',
|
|
||||||
OnDisconnect = '[noauth-probe.connecting] OnDisconnect',
|
|
||||||
}
|
|
||||||
|
|
||||||
export class OnConnect implements Action {
|
|
||||||
readonly type = ActionType.OnConnect;
|
|
||||||
|
|
||||||
constructor(public payload: NoAuthProbe) {}
|
|
||||||
}
|
|
||||||
|
|
||||||
export class OnDisconnect implements Action {
|
|
||||||
readonly type = ActionType.OnDisconnect;
|
|
||||||
|
|
||||||
constructor(public payload: NoAuthProbe) {}
|
|
||||||
}
|
|
||||||
|
|
||||||
export type Actions =
|
|
||||||
| OnConnect
|
|
||||||
| OnDisconnect
|
|
||||||
;
|
|
|
@ -1,15 +0,0 @@
|
||||||
import { TestBed, inject } from '@angular/core/testing';
|
|
||||||
|
|
||||||
import { Effects } from './noauth-probe-connecting.effect';
|
|
||||||
|
|
||||||
describe('noauth-probe-connecting.Effects', () => {
|
|
||||||
beforeEach(() => {
|
|
||||||
TestBed.configureTestingModule({
|
|
||||||
providers: [Effects]
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should be created', inject([Effects], (effects: Effects) => {
|
|
||||||
expect(effects).toBeTruthy();
|
|
||||||
}));
|
|
||||||
});
|
|
|
@ -1,23 +0,0 @@
|
||||||
import { Injectable } from '@angular/core';
|
|
||||||
import { Router } from '@angular/router';
|
|
||||||
|
|
||||||
import { Effect, Actions, ofType } from '@ngrx/effects';
|
|
||||||
import { Action } from '@ngrx/store';
|
|
||||||
|
|
||||||
import { RPCClientError } from '@loafer/ng-rpc';
|
|
||||||
import { NoAuthProbeService } from '../../service/noauth-probe.service';
|
|
||||||
|
|
||||||
import {
|
|
||||||
ActionType,
|
|
||||||
} from './noauth-probe-connecting.action';
|
|
||||||
|
|
||||||
@Injectable()
|
|
||||||
export class Effects {
|
|
||||||
|
|
||||||
constructor(
|
|
||||||
private actions$: Actions,
|
|
||||||
private noAuthProbeService: NoAuthProbeService,
|
|
||||||
private router: Router
|
|
||||||
) { }
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,21 +0,0 @@
|
||||||
import { ActionType, Actions } from './noauth-probe-connecting.action';
|
|
||||||
import {
|
|
||||||
State,
|
|
||||||
initialState,
|
|
||||||
noAuthProbeConnectingAdapter,
|
|
||||||
} from './noauth-probe-connecting.state';
|
|
||||||
|
|
||||||
export function reducer(state = initialState, action: Actions): State {
|
|
||||||
switch (action.type) {
|
|
||||||
case ActionType.OnConnect: {
|
|
||||||
return noAuthProbeConnectingAdapter.upsertOne(action.payload, state);
|
|
||||||
}
|
|
||||||
case ActionType.OnDisconnect: {
|
|
||||||
return noAuthProbeConnectingAdapter.upsertOne(action.payload, state);
|
|
||||||
}
|
|
||||||
|
|
||||||
default: {
|
|
||||||
return state;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,17 +0,0 @@
|
||||||
import { RPCClientError } from '@loafer/ng-rpc';
|
|
||||||
|
|
||||||
import { NoAuthProbe } from '@overflow/commons-typescript/model/noauth';
|
|
||||||
import { Selector, createSelector } from '@ngrx/store';
|
|
||||||
import { createEntityAdapter, EntityState } from '@loafer/ng-entity';
|
|
||||||
|
|
||||||
export const noAuthProbeConnectingAdapter = createEntityAdapter<NoAuthProbe, RPCClientError>();
|
|
||||||
export interface State extends EntityState<NoAuthProbe, RPCClientError> {
|
|
||||||
}
|
|
||||||
export const initialState: State = noAuthProbeConnectingAdapter.getInitialState({
|
|
||||||
});
|
|
||||||
|
|
||||||
export function getSelectors(selector: Selector<any, State>) {
|
|
||||||
return {
|
|
||||||
...noAuthProbeConnectingAdapter.getSelectors(selector),
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,27 +0,0 @@
|
||||||
import {
|
|
||||||
createSelector,
|
|
||||||
createFeatureSelector,
|
|
||||||
} from '@ngrx/store';
|
|
||||||
|
|
||||||
import { MODULE } from '../noauth-probe.constant';
|
|
||||||
|
|
||||||
import * as NoAuthProbeConnectingStore from './connecting';
|
|
||||||
|
|
||||||
export interface State {
|
|
||||||
connecting: NoAuthProbeConnectingStore.State;
|
|
||||||
}
|
|
||||||
|
|
||||||
export const REDUCERS = {
|
|
||||||
connecting: NoAuthProbeConnectingStore.reducer,
|
|
||||||
};
|
|
||||||
|
|
||||||
export const EFFECTS = [
|
|
||||||
NoAuthProbeConnectingStore.Effects,
|
|
||||||
];
|
|
||||||
|
|
||||||
export const selectState = createFeatureSelector<State>(MODULE.name);
|
|
||||||
|
|
||||||
export const NoAuthProbeConnectingSelector = NoAuthProbeConnectingStore.getSelectors(createSelector(
|
|
||||||
selectState,
|
|
||||||
(state: State) => state.connecting
|
|
||||||
));
|
|
|
@ -7,8 +7,6 @@ import { LoggerService } from '@loafer/ng-logger';
|
||||||
|
|
||||||
import { NoAuthProbe } from '@overflow/commons-typescript/model/noauth';
|
import { NoAuthProbe } from '@overflow/commons-typescript/model/noauth';
|
||||||
|
|
||||||
import * as NoAuthProbeConnectingStore from '../store/connecting';
|
|
||||||
|
|
||||||
export interface NoAuthProbeNotify {
|
export interface NoAuthProbeNotify {
|
||||||
method: string;
|
method: string;
|
||||||
params: NoAuthProbe;
|
params: NoAuthProbe;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user