2023-02-23 18:43:16 +00:00
|
|
|
import { I_AM_VISITOR_MODE, UPDATE_VISITORS_COUNT } from './actionTypes';
|
2023-02-08 17:48:11 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets Visitors mode on or off.
|
|
|
|
*
|
|
|
|
* @param {boolean} enabled - The new visitors mode state.
|
|
|
|
* @returns {{
|
2023-02-23 18:43:16 +00:00
|
|
|
* type: I_AM_VISITOR_MODE,
|
2023-02-08 17:48:11 +00:00
|
|
|
* }}
|
|
|
|
*/
|
2023-02-23 18:43:16 +00:00
|
|
|
export function setIAmVisitor(enabled: boolean) {
|
2023-02-08 17:48:11 +00:00
|
|
|
return {
|
2023-02-23 18:43:16 +00:00
|
|
|
type: I_AM_VISITOR_MODE,
|
2023-02-08 17:48:11 +00:00
|
|
|
enabled
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Visitors count has been updated.
|
|
|
|
*
|
|
|
|
* @param {number} count - The new visitors count.
|
|
|
|
* @returns {{
|
|
|
|
* type: UPDATE_VISITORS_COUNT,
|
|
|
|
* }}
|
|
|
|
*/
|
|
|
|
export function updateVisitorsCount(count: number) {
|
|
|
|
return {
|
|
|
|
type: UPDATE_VISITORS_COUNT,
|
|
|
|
count
|
|
|
|
};
|
|
|
|
}
|