mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 18:14:17 +00:00
86016: Add typedocs
This commit is contained in:
@@ -5,6 +5,9 @@ export const CorrelationIDActionTypes = {
|
|||||||
SET: type('dspace/core/correlationId/SET')
|
SET: type('dspace/core/correlationId/SET')
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Action for setting a new correlation ID
|
||||||
|
*/
|
||||||
export class SetCorrelationIdAction implements Action {
|
export class SetCorrelationIdAction implements Action {
|
||||||
type = CorrelationIDActionTypes.SET;
|
type = CorrelationIDActionTypes.SET;
|
||||||
|
|
||||||
@@ -12,4 +15,7 @@ export class SetCorrelationIdAction implements Action {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Type alias for all correlation ID actions
|
||||||
|
*/
|
||||||
export type CorrelationIdAction = SetCorrelationIdAction;
|
export type CorrelationIdAction = SetCorrelationIdAction;
|
||||||
|
@@ -9,6 +9,12 @@ const initialState = null;
|
|||||||
|
|
||||||
export const correlationIdSelector = (state: AppState) => state.correlationId;
|
export const correlationIdSelector = (state: AppState) => state.correlationId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reducer that handles actions to update the correlation ID
|
||||||
|
* @param {string} state the previous correlation ID (null if unset)
|
||||||
|
* @param {CorrelationIdAction} action the action to perform
|
||||||
|
* @return {string} the new correlation ID
|
||||||
|
*/
|
||||||
export const correlationIdReducer = (state = initialState, action: CorrelationIdAction): string => {
|
export const correlationIdReducer = (state = initialState, action: CorrelationIdAction): string => {
|
||||||
switch (action.type) {
|
switch (action.type) {
|
||||||
case CorrelationIDActionTypes.SET: {
|
case CorrelationIDActionTypes.SET: {
|
||||||
|
Reference in New Issue
Block a user