“Action -Typ von erregeren Redux abrufen” Code-Antworten

React Redux -Aktionstypen reagieren

export const CREATE_TUTORIAL = "CREATE_TUTORIAL";
export const RETRIEVE_TUTORIALS = "RETRIEVE_TUTORIALS";
export const UPDATE_TUTORIAL = "UPDATE_TUTORIAL";
export const DELETE_TUTORIAL = "DELETE_TUTORIAL";
export const DELETE_ALL_TUTORIALS = "DELETE_ALL_TUTORIALS";
Junior Grepper

Redux -Aktionstypen

export const CAMPSITES_LOADING = 'CAMPSITES_LOADING';
export const ADD_CAMPSITES = 'ADD_CAMPSITES';
export const CAMPSITES_FAILED = 'CAMPSITES_FAILED';

export const ADD_COMMENTS = 'ADD_COMMENTS';
export const COMMENTS_FAILED = 'COMMENTS_FAILED';

export const PROMOTIONS_LOADING = 'PROMOTIONS_LOADING';
export const ADD_PROMOTIONS = 'ADD_PROMOTIONS';
export const PROMOTIONS_FAILED = 'PROMOTIONS_FAILED';

export const PARTNERS_LOADING = 'PARTNERS_LOADING';
export const ADD_PARTNERS = 'ADD_PARTNERS';
export const PARTNERS_FAILED = 'PARTNERS_FAILED';
Helpless Hummingbird

Action -Typ von erregeren Redux abrufen

const storeSlice = createSlice({
  //...
  reducers: {
    fetchData: (state, action: PayloadAction<string>) => {
      //...
    onFetchFailed: (state, action: PayloadAction<string>) => {
      //...
    },
  },
});
type SliceActions<T> = {
  [K in keyof T]: {type: K; payload: T[K] extends (...args: infer P) => void ? P[0] : never};
}[keyof T];

/* 
ActionTypes = {
    type: "fetchData";
    payload: string;
} | {
    type: "onFetchFailed";
    payload: string;
}
*/
type ActionTypes = SliceActions<typeof storeSlice.actions>;
Friendly Flamingo

Ähnliche Antworten wie “Action -Typ von erregeren Redux abrufen”

Fragen ähnlich wie “Action -Typ von erregeren Redux abrufen”

Weitere verwandte Antworten zu “Action -Typ von erregeren Redux abrufen” auf JavaScript

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen