26 lines
730 B
TypeScript
26 lines
730 B
TypeScript
import { Selector, createSelector } from '@ngrx/store';
|
|
import { RPCClientError } from '@loafer/ng-rpc';
|
|
|
|
export interface State {
|
|
secretKey: string;
|
|
sourceURI: string;
|
|
pending: boolean;
|
|
error: RPCClientError;
|
|
}
|
|
|
|
export const initialState: State = {
|
|
secretKey: null,
|
|
sourceURI: null,
|
|
pending: false,
|
|
error: null,
|
|
};
|
|
|
|
export function getSelectors(selector: Selector<any, State>) {
|
|
return {
|
|
selectSecretKey: createSelector(selector, (state: State) => state.secretKey),
|
|
selectSourceURI: createSelector(selector, (state: State) => state.sourceURI),
|
|
selectPending: createSelector(selector, (state: State) => state.pending),
|
|
selectError: createSelector(selector, (state: State) => state.error),
|
|
};
|
|
}
|