2025-01-28 11:52:56 +01:00
|
|
|
/**
|
|
|
|
* Action Creators: Define functions to create action objects.
|
|
|
|
*
|
|
|
|
* These functions update state or trigger side effects (e.g., async operations).
|
|
|
|
* Actions are categorized as Transient, Persistent, or Side effect.
|
|
|
|
*
|
|
|
|
* @file
|
|
|
|
*/
|
|
|
|
|
|
|
|
import ACTION_TYPES from './action-types';
|
|
|
|
|
|
|
|
export const setIsReady = ( isReady ) => ( {
|
|
|
|
type: ACTION_TYPES.SET_TRANSIENT,
|
|
|
|
payload: { isReady },
|
|
|
|
} );
|
|
|
|
|
|
|
|
export const setTodos = ( todos ) => ( {
|
|
|
|
type: ACTION_TYPES.SET_TODOS,
|
|
|
|
payload: todos,
|
|
|
|
} );
|
|
|
|
|
2025-01-30 12:54:05 +01:00
|
|
|
export const setDismissedTodos = ( dismissedTodos ) => ( {
|
|
|
|
type: ACTION_TYPES.SET_DISMISSED_TODOS,
|
|
|
|
payload: dismissedTodos,
|
|
|
|
} );
|
|
|
|
|
2025-01-28 11:52:56 +01:00
|
|
|
export const fetchTodos = function* () {
|
|
|
|
yield { type: ACTION_TYPES.DO_FETCH_TODOS };
|
|
|
|
};
|